Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IE9 does 0x00 byte truncation after message decoding with MessageEvent #133

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion web_socket.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@
logger = {log: function(){ }, error: function(){ }};
}

var isIE9;
if(navigator.userAgent.indexOf("Trident/5")>-1) {
isIE9 = true;
} else {
isIE9 = false;
}

// swfobject.hasFlashPlayerVersion("10.0.0") doesn't work with Gnash.
if (swfobject.getFlashPlayerVersion().major < 10) {
logger.error("Flash Player >= 10.0.0 is required.");
Expand Down Expand Up @@ -203,7 +210,7 @@
};

WebSocket.prototype.__createMessageEvent = function(type, data) {
if (document.createEvent && window.MessageEvent && !window.opera) {
if (document.createEvent && window.MessageEvent && !window.opera && !isIE9) {
var event = document.createEvent("MessageEvent");
event.initMessageEvent("message", false, false, data, null, null, window, null);
return event;
Expand Down