var WebSocketWrapper function pushstream var ver if Safari test naviga

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
var WebSocketWrapper = function(pushstream) {
var ver;
if (/Safari/i.test(navigator.userAgent) && (ver = navigator.userAgent.match(/Version\/([\d]+)/i))) {
ver = +ver[1];
if (ver < 6)
throw "WebSocket not supported";
}
if (!window.WebSocket && !window.MozWebSocket) { throw "WebSocket not supported"; }
this.type = WebSocketWrapper.TYPE;
this.pushstream = pushstream;
this.connection = null;
};