diff --git a/rlgterm.js b/rlgterm.js index 786b97b..ae96cb7 100644 --- a/rlgterm.js +++ b/rlgterm.js @@ -417,7 +417,7 @@ function setup() { 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 @@ function tableCurrent(gamelist) { /* 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 wsCurrent() { } function getcurrent(clear) { - if (WebSocket) { + if (window.WebSocket) { return; } if (session.id || clear) { @@ -674,7 +674,7 @@ function makeStarter(gname) { function startgame(game) { if (session.id != null || !session.lcred) return; - if (WebSocket) { + if (window.WebSocket) { wsStart(game); return; } @@ -794,7 +794,7 @@ function wsStart(game) { function startwatching(gamenumber) { if (session.id != null) return; - if (WebSocket) { + if (window.WebSocket) { wsWatch(gamenumber); return; }