comparison lightstring.js @ 40:e02bfcb78428

priority to WebSocket
author Sonny Piers <sonny.piers@gmail.com>
date Tue, 31 Jan 2012 15:25:30 +0100
parents 5e32481b8a92
children 2895891f19bb
comparison
equal deleted inserted replaced
39:5e32481b8a92 40:e02bfcb78428
263 if (!this.password) 263 if (!this.password)
264 throw 'Lightstring: Connection.password is undefined.'; 264 throw 'Lightstring: Connection.password is undefined.';
265 if (!this.service) 265 if (!this.service)
266 throw 'Lightstring: Connection.service is undefined.'; 266 throw 'Lightstring: Connection.service is undefined.';
267 267
268 //"Bug 695635 - tracking bug: unprefix WebSockets" https://bugzil.la/695635 268 if(typeof(WebSocket) === "function") {
269 if(typeof(MozWebSocket) == "function") { 269 this.socket = new WebSocket(this.service, 'xmpp');
270 }
271 else if(typeof(MozWebSocket) === "function") {
270 this.socket = new MozWebSocket(this.service, 'xmpp'); 272 this.socket = new MozWebSocket(this.service, 'xmpp');
271 }
272 else if(typeof(WebSocket) == "function") {
273 this.socket = new WebSocket(this.service, 'xmpp');
274 } 273 }
275 else { 274 else {
276 throw new Error('WebSocket not available.'); 275 throw new Error('WebSocket not available.');
277 } 276 }
278 277