]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
webui: comet - don't use websockets for Safari browsers, fixes #4589
authorJaroslav Kysela <perex@perex.cz>
Thu, 14 Sep 2017 11:44:03 +0000 (13:44 +0200)
committerJaroslav Kysela <perex@perex.cz>
Thu, 14 Sep 2017 11:46:08 +0000 (13:46 +0200)
https://bugs.webkit.org/show_bug.cgi?id=80362

Note: Probably all other "plain" webkit browsers are affected until
the above bug is resolved.

src/webui/static/app/comet.js

index 8673c17fbe706e90b3fff1e57194b27960a1a8c2..2f0e89eed7ba3a3395afcdb088525f2394905adb 100644 (file)
@@ -96,7 +96,9 @@ tvheadend.cometWebsocket = function() {
 };
 
 tvheadend.cometInit = function() {
-    if ("WebSocket" in window) {
+    var isSafari = navigator.vendor && navigator.vendor.indexOf('Apple') > -1 &&
+                   navigator.userAgent && !navigator.userAgent.match('CriOS');
+    if (!isSafari && ("WebSocket" in window)) {
       var loc = window.location;
       var path = loc.pathname.substring(0, loc.pathname.lastIndexOf("/"));
       tvheadend.wsURI = (loc.protocol === "https:" ? "wss:" : "ws:") + "//" + loc.host + path + "/comet/ws";