/*
 * jQuery Web Sockets Plugin v0.0.3
 * https://github.com/dchelimsky/jquery-websocket
 * http://code.google.com/p/jquery-websocket/
 *
 * This document is licensed as free software under the terms of the
 * MIT License: http://www.opensource.org/licenses/mit-license.php
 *
 * Copyright (c) 2010 by shootaroo (Shotaro Tsubouchi).
 */
(function($){
    $.extend({
        websocket: function(url, s, protocols) {
            var ws = window['MozWebSocket'] ? new MozWebSocket(url, protocols || []) : window['WebSocket'] ? new WebSocket(url, protocols || []) : {
                send: function(m){ return false; },
                close: function(){}
            };
            var settings = {
                open: function(){},
                close: function(){},
                message: function(){},
                options: {},
                events: {}
            };
            $.extend(settings, $.websocketSettings, s);
            $(ws)
                .bind('open', settings.open)
                .bind('close', settings.close)
                .bind('message', settings.message)
                .bind('message', function(e) {
                    var m = $.evalJSON(e.originalEvent.data);
                    var h = settings.events[m.type];
                    if (h) h.call(this, m);
                });
            ws._send = ws.send;
            ws.send = function(type, data) {
                var m = {type: type};
                m = $.extend(true, m, $.extend(true, {}, settings.options, m));
                if (data) m['data'] = data;
                return this._send($.toJSON(m));
            };
            $(window).unload(function(){ ws.close(); ws = null; });
            return ws;
        }
    });
})(jQuery);

@@ -424,16 +424,67 @@
     var 
+ws;%0A            if ( protocols ) %7B%0A                
 ws = win
@@ -532,30 +532,24 @@
 l, protocols
- %7C%7C %5B%5D
 ) : window%5B'
@@ -594,71 +594,159 @@
 cols
- %7C%7C %5B%5D) : %7B%0A                send: function(m)%7B r
+) : false;%0A            %7D else %7B%0A                ws = window%5B'MozWebSocket'%5D ? new MozWebSocket(url) : window%5B'WebSocket'%5D ? new WebSock
 et
+(
 ur
-n
+l) :
  false;
- %7D,
 %0A   
@@ -754,38 +754,16 @@
         
-    close: function()%7B
 %7D%0A      
@@ -760,34 +760,32 @@
   %7D%0A            
-%7D;
 %0A            var
@@ -1053,14 +1053,69 @@
     
+%0A            if ( ws !== false ) %7B%0A                
 $(ws)%0A
+    
     
@@ -1167,24 +1167,28 @@
             
+    
 .bind('close
@@ -1206,16 +1206,20 @@
 .close)%0A
+    
         
@@ -1269,32 +1269,36 @@
                 
+   
+ 
 .bind('message',
@@ -1308,24 +1308,28 @@
 nction(e) %7B%0A
+    
             
@@ -1394,24 +1394,28 @@
             
+    
 var h = sett
@@ -1451,24 +1451,28 @@
             
+  
+  
 if (h) h.cal
@@ -1483,16 +1483,20 @@
 is, m);%0A
+    
         
@@ -1519,16 +1519,20 @@
         
+    
 ws._send
@@ -1555,16 +1555,20 @@
         
+ 
+   
 ws.send 
@@ -1600,32 +1600,36 @@
                 
+    
 var m = %7Btype: t
@@ -1634,16 +1634,20 @@
  type%7D;%0A
+    
         
@@ -1730,24 +1730,28 @@
             
+    
 if (data) m%5B
@@ -1766,16 +1766,20 @@
 = data;%0A
+    
         
@@ -1822,35 +1822,43 @@
 ));%0A            
+   
+ 
 %7D;%0A
+    
             $(wi
@@ -1905,24 +1905,51 @@
 = null; %7D);%0A
+            %7D%0A            %0A
             

Don't pass protocols to WebSocket and return false