From 48a6e238641754f67a4d164d676d1de20411b0ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Preu=C3=9F?= Date: Sat, 26 Oct 2013 00:44:19 +0200 Subject: [PATCH] Safari <= 5.1 Fix Override Safari's (old) WebSocket and force to flash --- web_socket.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/web_socket.js b/web_socket.js index 06cc5d0..3d934b2 100644 --- a/web_socket.js +++ b/web_socket.js @@ -4,10 +4,15 @@ // Reference: http://tools.ietf.org/html/rfc6455 (function() { - + /* Safari Fix */ + if(typeof(navigator.userAgent) != 'undefined' && (navigator.userAgent.indexOf('Safari') && navigator.userAgent.indexOf('/5.1'))) { + WebSocket = function(url) { return undefined; }; + WebSocket.prototype.deprecated = function() { return true; }; + } + if (window.WEB_SOCKET_FORCE_FLASH) { // Keeps going. - } else if (window.WebSocket) { + } else if (window.WebSocket && typeof(WebSocket.deprecated) != 'undefined') { return; } else if (window.MozWebSocket) { // Firefox.