فهرست منبع

[edit][chrome]

zhangwei 3 سال پیش
والد
کامیت
55b1ee38c2
2فایلهای تغییر یافته به همراه11 افزوده شده و 6 حذف شده
  1. 4 1
      pages/index.vue
  2. 7 5
      utils/help.js

+ 4 - 1
pages/index.vue

@@ -122,7 +122,7 @@
 				<div class="title">Open Giveaways</div>
 				<div class="title">with chrome</div>
 				<div class="tip">Only supports getting Giveaways through chrome</div>
-				<div class="install_chrome" @click="window.open('https://www.google.com/chrome')">
+				<div class="install_chrome" @click="clickOpenChrome()">
 					<img src="/svg/icon-chrome.svg" alt />
 					Install Chrome
 				</div>
@@ -264,6 +264,9 @@ export default {
 		}
 	},
 	methods: {
+		clickOpenChrome(){
+			window.open('https://www.google.com/chrome')
+		},
 		isMobile() {
 			let flag = navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i);
 			return flag;

+ 7 - 5
utils/help.js

@@ -28,13 +28,9 @@ export function isBrowser() {
             }
             return false;
         }
-        if (agent.indexOf("chrome") > 0) {
-            return 'chrome'
-        }
-
     }
     let s = System()
-    if(s){
+    if (s) {
         return s
     }
     if (agent.indexOf('firefox') > 0) {
@@ -43,7 +39,13 @@ export function isBrowser() {
     if (agent.indexOf('trident') > 0) {
         return "IE浏览器"
     }
+    if (agent.indexOf('edg') > 0) {
+        return "IE浏览器"
+    }
     if (agent.indexOf("safari") > 0 && agent.indexOf("chrome") < 0) {
         return 'Safari'
     }
+    if (agent.indexOf("chrome") > 0) {
+        return 'chrome'
+    }
 }