jfinn пре 5 година
родитељ
комит
79c4710c22
1 измењених фајлова са 26 додато и 0 уклоњено
  1. 26
    0
      inline_script.js

+ 26
- 0
inline_script.js Прегледај датотеку

@@ -1,10 +1,36 @@
1 1
     // <script>
2 2
         // IE11 and earlier can be identified via their user agent and be
3 3
         // redirected to a page that is known to have no newer js syntax.
4
+
5
+        /*
4 6
         if (window.navigator.userAgent.match(/(MSIE|Trident)/)) {
5 7
             var roomName = encodeURIComponent(window.location.pathname);
6 8
             window.location.href = "static/recommendedBrowsers.html" + "?room=" + roomName;
7 9
         }
10
+        */
11
+        {
12
+            var browser;
13
+            var agent = navigator.userAgent.match(/(opera|chrome|safari|firefox|msie)\/?\s*(\.?\d+(\.\d+)*)/i);
14
+            if (navigator.userAgent.match(/Edge/i) || navigator.userAgent.match(/Trident.*rv[ :]*11\./i)) {
15
+                browser = "msie";
16
+            }       
17
+            else {
18
+    browser = agent[1].toLowerCase();
19
+}
20
+            if (browser != "chrome"){
21
+                
22
+            var roomName = encodeURIComponent(window.location.pathname);
23
+            window.location.href = "static/recommendedBrowsers_chrome_only.html" + "?room=" + roomName;
24
+            }
25
+
26
+
27
+        // if (window.navigator.userAgent.match(/(MSIE|Trident)/)) {
28
+            // var roomName = encodeURIComponent(window.location.pathname);
29
+            // window.location.href = "static/recommendedBrowsers_chrome_only.html" + "?room=" + roomName;
30
+        // }
31
+        }
32
+
33
+
8 34
 
9 35
         window.indexLoadedTime = window.performance.now();
10 36
         console.log("(TIME) index.html loaded:\t", indexLoadedTime);

Loading…
Откажи
Сачувај