Permalink
Browse files

FF6 support

  • Loading branch information...
1 parent 1378830 commit 160227947003b0ae24f24357ec9f0bbdb514259f @lifo committed Aug 30, 2011
Showing with 4 additions and 2 deletions.
  1. +4 −2 app/views/index.erb
View
@@ -5,7 +5,7 @@
<script src='http://datejs.googlecode.com/svn/trunk/build/date.js'></script>
<script>
$(document).ready(function(){
- if (typeof WebSocket != 'undefined') {
+ if (typeof(WebSocket) != 'undefined' || typeof(MozWebSocket)) {
$('#ask').show();
} else {
$('#error').show();
@@ -28,7 +28,9 @@ $(document).ready(function(){
function join(name) {
var host = window.location.host.split(':')[0];
- var ws = new WebSocket('ws://<%= request.host_with_port %>/websocket');
+
+ var SocketKlass = "MozWebSocket" in window ? MozWebSocket : WebSocket;
+ var ws = new SocketKlass('ws://<%= request.host_with_port %>/websocket');
var container = $('div#msgs');
ws.onmessage = function(evt) {

0 comments on commit 1602279

Please sign in to comment.