2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-13 23:36:37 +00:00

fhemweb.js: Fix crash on older Browser due tu missing websocket (Forum #64276)

git-svn-id: https://svn.fhem.de/fhem/trunk@13021 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2017-01-09 10:51:18 +00:00
parent 1d54fcafd1
commit 398f1bdd80

View File

@ -689,7 +689,8 @@ FW_doUpdate(evt)
}
FW_lastDataTime = now;
if(evt.target instanceof WebSocket) {
// Websocket starts with Android 4.4, and IE10
if(typeof WebSocket == "function" && evt.target instanceof WebSocket) {
if(evt.type == 'close' && !FW_leaving) {
FW_errmsg(errstr, retryTime-100);
FW_pollConn.close();
@ -849,7 +850,7 @@ FW_longpoll()
"&timestamp="+new Date().getTime();
query = addcsrf(query);
if(FW_longpollType == "websocket") {
if(typeof WebSocket == "function" && FW_longpollType == "websocket") {
FW_pollConn = new WebSocket((location+query).replace(/^http/i, "ws"));
FW_pollConn.onclose =
FW_pollConn.onerror =