diff --git a/web_socket.js b/web_socket.js index 06cc5d0..6845d30 100644 --- a/web_socket.js +++ b/web_socket.js @@ -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."); @@ -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;