mo 1 year ago
parent
commit
df7c476717
2 changed files with 19 additions and 66 deletions
  1. 19 66
      dist/index.html
  2. 0 0
      dist/sw.js

+ 19 - 66
dist/index.html

@@ -106,23 +106,6 @@
         window.open('https://appstore.ks3-cn-beijing.ksyuncs.com/googlechrome-mac.dmg');
       }
     }
-    const check360 = () => {
-      console.log(navigator)
-      const result = false;
-      for (const key in navigator.plugins) {
-        // np-mswmp.dll只在360浏览器下存在
-        // if (navigator.plugins[key].filename == 'internal-nacl-plugin') {
-        //   console.log('来到插件')
-        //   return !result;
-        // }
-        if (navigator.plugins[key].filename == 'np-mswmp.dll') {
-          console.log('来到插件')
-          return !result;
-        }
-
-      }
-      return result;
-    };
     function getChromeVersion() {
       var arr = navigator.userAgent.split(' ');
       var chromeVersion = '';
@@ -144,54 +127,21 @@
       return false;
     }
 
-    const isChrome = () => {
-
-      const isChromium = window.chrome,
-        winNav = window.navigator,
-        vendorName = winNav.vendor,
-        isOpera = winNav.userAgent.indexOf('OPR') > -1,
-        isIEedge = winNav.userAgent.indexOf('Edge') > -1,
-        isIOSChrome = winNav.userAgent.match('CriOS'),
-        // QQ
-        isQQBriwser =
-          winNav.userAgent.indexOf('QQBrowser') > -1 ||
-          winNav.userAgent.indexOf('QQ') > -1,
-        // 搜狗
-        isSouggou =
-          winNav.userAgent.indexOf('se 2.x') > -1 ||
-          winNav.userAgent.indexOf('MetaSr') > -1,
-        // 360
-        is360 = check360(),
-        // 遨游
-        isMaxthon = winNav.userAgent.indexOf('Maxthon') > -1,
-        // 是否为2345浏览器
-        is2345Explorer = winNav.userAgent.includes('2345Explorer'),
-        // 世界之窗
-        isTheWorld = winNav.userAgent.indexOf('TheWorld') > -1,
-        // 猎豹
-        isLiebao = winNav.userAgent.indexOf('LBBROWSER') > -1;
-      console.log(winNav.userAgent)
-      console.log(isQQBriwser, isSouggou, is360, isMaxthon, is2345Explorer, isTheWorld, isLiebao)
-      if (isIOSChrome) {
-        return true;
-      } else if (
-        isChromium !== null &&
-        typeof isChromium !== 'undefined' &&
-        vendorName === 'Google Inc.' &&
-        isOpera === false &&
-        isIEedge === false &&
-        isQQBriwser === false &&
-        isSouggou === false &&
-        is360 === false &&
-        isMaxthon === false &&
-        is2345Explorer === false &&
-        isTheWorld === false &&
-        isLiebao === false
-      ) {
-        return true;
-      } else {
-        return false;
-      }
+    function isChrome() {
+      var isChromium = window.chrome;
+      var winNav = window.navigator;
+      var vendorName = winNav.vendor;
+      var isOpera = typeof window.opr !== 'undefined';
+      var isIEedge = winNav.userAgent.indexOf('Edge') > -1;
+      var isIOSChrome = winNav.userAgent.match('CriOS');
+      return (
+        isIOSChrome ||
+        (isChromium !== null &&
+          typeof isChromium !== 'undefined' &&
+          vendorName === 'Google Inc.' &&
+          isOpera === false &&
+          isIEedge === false)
+      );
     };
     function IEVersion() {
       var userAgent = navigator.userAgent; //取得浏览器的userAgent字符串
@@ -224,16 +174,19 @@
     (function (window) {
       if (!isChrome()) {
         // document.writeln("<div class='imgWrap'><img src='https://gyt.ks3-cn-beijing.ksyuncs.com/basic/1688699993534.png' class='bgImg' alt=''><img src='https://gyt.ks3-cn-beijing.ksyuncs.com/basic/1688699779209.png' class='btnImg' alt=''></div>");
+
+
         if (IEVersion() < 9 && IEVersion() != -1) {
+
           document.writeln(" <div class='textWrap'><h1>当前浏览器版本过低</h1><p class='subMsg'>为了保证良好的上课体验,推荐您使用谷歌浏览器</p> <button class='subBtn' onclick='gotoLinlk()'>下载谷歌浏览器</button>");
           document.execCommand("Stop");
         } else {
           document.writeln(" <div class='imgWrap'><img onabort='this.src=this.src' src='https://gyt.ks3-cn-beijing.ksyuncs.com/basic/1688699993534.png' class='bgImg' alt=''><img src='https://gyt.ks3-cn-beijing.ksyuncs.com/basic/1688699779209.png'  onabort='this.src=this.src' onclick='gotoLinlk()' class='btnImg' alt=''></div>");
           document.execCommand("Stop");
-          window.stop()
         }
       } else {
         if (getChromeVersion() < 90) {
+
           document.writeln(" <div class='imgWrap'><img src='https://gyt.ks3-cn-beijing.ksyuncs.com/basic/1688699993534.png' class='bgImg' alt=''><img src='https://gyt.ks3-cn-beijing.ksyuncs.com/basic/1688699779209.png' onclick='gotoLinlk()' class='btnImg' alt=''></div>");
           document.execCommand("Stop");
           window.stop()

File diff suppressed because it is too large
+ 0 - 0
dist/sw.js


Some files were not shown because too many files changed in this diff