Fix WebSocket support checking.
Check for window.WebSocket instead of WebSocket.
This commit is contained in:
parent
59f3a10220
commit
55f7c3e7de
1 changed files with 5 additions and 5 deletions
10
rlgterm.js
10
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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue