# HG changeset patch # User John "Elwin" Edwards # Date 1342475524 25200 # Node ID d7d7cdcba3b49fdc0f9c80283356f7d36078c946 # Parent 7ef3a1a084b90e2b8f63584f2ae497fe88d462f8 Fix WebSocket support checking. Check for window.WebSocket instead of WebSocket. diff -r 7ef3a1a084b9 -r d7d7cdcba3b4 rlgterm.js --- a/rlgterm.js Mon Jul 16 10:28:55 2012 -0700 +++ b/rlgterm.js Mon Jul 16 14:52:04 2012 -0700 @@ -417,7 +417,7 @@ else break; } - if (!WebSocket) { + if (!window.WebSocket) { message("Your browser does not support WebSockets. You can still play, " + "but it will be slower, and may not work in the future.", "warn"); } @@ -523,7 +523,7 @@ /* Handles the status socket, opening and closing it when necessary. */ function wsCurrent() { - if (!WebSocket) + if (!window.WebSocket) return; if (session.id) { /* Don't bother with status if already playing/watching. */ @@ -561,7 +561,7 @@ } function getcurrent(clear) { - if (WebSocket) { + if (window.WebSocket) { return; } if (session.id || clear) { @@ -674,7 +674,7 @@ function startgame(game) { if (session.id != null || !session.lcred) return; - if (WebSocket) { + if (window.WebSocket) { wsStart(game); return; } @@ -794,7 +794,7 @@ function startwatching(gamenumber) { if (session.id != null) return; - if (WebSocket) { + if (window.WebSocket) { wsWatch(gamenumber); return; }