In Opera 12.10, set binaryType earlier.
Otherwise, the first message received may be blob depending on timing.
This commit is contained in:
parent
1d795c0643
commit
c33f0b52e7
|
@ -331,6 +331,9 @@ function open(uri, protocols) {
|
|||
websocket = {};
|
||||
} else {
|
||||
websocket = new WebSocket(uri, protocols);
|
||||
if (protocols.indexOf('binary') >= 0) {
|
||||
websocket.binaryType = 'arraybuffer';
|
||||
}
|
||||
}
|
||||
|
||||
websocket.onmessage = recv_message;
|
||||
|
@ -343,9 +346,6 @@ function open(uri, protocols) {
|
|||
mode = 'base64';
|
||||
Util.Error("Server select no sub-protocol!: " + websocket.protocol);
|
||||
}
|
||||
if (mode === 'binary') {
|
||||
websocket.binaryType = 'arraybuffer';
|
||||
}
|
||||
eventHandlers.open();
|
||||
Util.Debug("<< WebSock.onopen");
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue