|
@@ -24,9 +24,9 @@
|
|
|
var ieAX = win.ActiveXObject;
|
|
|
var ieMode = doc.documentMode;
|
|
|
var REG_APPLE = /^Apple/;
|
|
|
- var ieVer = _getIeVersion() || ieMode || 0;
|
|
|
+ // var ieVer = _getIeVersion() || ieMode || 0;
|
|
|
var isIe = ieAX || ieMode;
|
|
|
- var chromiumType = _getChromiumType();
|
|
|
+ // var chromiumType = _getChromiumType();
|
|
|
/**
|
|
|
* 检测 external 是否包含该字段
|
|
|
* @param reg 正则
|
|
@@ -66,7 +66,7 @@
|
|
|
|
|
|
var _track = 'track' in document.createElement('track');
|
|
|
var webstoreKeysLength = win.chrome && win.chrome.webstore ? Object.keys(win.chrome.webstore).length : 0;
|
|
|
-
|
|
|
+ console.log(webstoreKeysLength)
|
|
|
// 搜狗浏览器
|
|
|
if (_testExternal(/^sogou/i, 0)) {
|
|
|
return 'sogou';
|
|
@@ -78,7 +78,7 @@
|
|
|
}
|
|
|
|
|
|
// chrome 由于360极速浏览器 内核也是 chrome,所以先判断360极速浏览器
|
|
|
- if (win.clientInformation && win.clientInformation.permissions && webstoreKeysLength <= 1) {
|
|
|
+ if (win.clientInformation && win.clientInformation.permissions) {
|
|
|
return 'chrome';
|
|
|
}
|
|
|
|
|
@@ -102,18 +102,30 @@
|
|
|
|
|
|
return v > 4 ? v : 0;
|
|
|
}
|
|
|
- var isChrome = (function () {
|
|
|
- return chromiumType === 'chrome';
|
|
|
- })()
|
|
|
+
|
|
|
+ function getBrowserInfo() {
|
|
|
+ const userAgent = navigator.userAgent.toLocaleLowerCase();
|
|
|
+ if (userAgent.match(/chrome/) != null) {
|
|
|
+ if (userAgent.match(/wow64/) != null) {
|
|
|
+ return false
|
|
|
+ } else {
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ var isChrome = getBrowserInfo()
|
|
|
var isCloseBrowser = sessionStorage.getItem('isCloseBrowser')
|
|
|
- // console.log(isChrome, isCloseBrowser)
|
|
|
+ console.log(isChrome, isCloseBrowser)
|
|
|
// 如果不是360浏览器会提示
|
|
|
if((!isChrome) && !isCloseBrowser) {
|
|
|
- document.querySelector('#notification_1').classList.remove('hide')
|
|
|
+ console.log(document.getElementById('notification_1').className)
|
|
|
+ document.getElementById('notification_1').className = 'el-notification right'
|
|
|
+ // document.getElementById('notification_1').classList.remove('hide')
|
|
|
sessionStorage.removeItem('isCloseBrowser')
|
|
|
}
|
|
|
- document.querySelector('#noClose').onclick = function() {
|
|
|
- document.querySelector('#notification_1').classList.add('hide')
|
|
|
+ document.getElementById('noClose').onclick = function() {
|
|
|
+ // document.getElementById('notification_1').classList.add('hide')
|
|
|
+ document.getElementById('notification_1').className = 'el-notification right hide'
|
|
|
sessionStorage.setItem('isCloseBrowser', 1)
|
|
|
}
|
|
|
</script>
|