var WebSocketWrapper function pushstream var ua navigator userAgent va

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
var WebSocketWrapper = function(pushstream) {
var ua = navigator.userAgent;
var ver;
if (/Safari/i.test(ua) && (ver = ua.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;
};