-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2078 from sspanel-uim/dev
Dev 20230712
- Loading branch information
Showing
11 changed files
with
317 additions
and
206 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,100 +1,104 @@ | ||
(function (window, navigator) { | ||
var userAgent = navigator.userAgent; | ||
var is360 = false; | ||
const userAgent = navigator.userAgent; | ||
let is360 = false; | ||
|
||
var hasMime = function (option, value) { | ||
var mimeTypes = navigator.mimeTypes; | ||
for (var mt in mimeTypes) { | ||
if (mimeTypes[mt][option] == value) { | ||
return true; | ||
} | ||
const hasMime = function (option, value) { | ||
const mimeTypes = navigator.mimeTypes; | ||
for (const mt in mimeTypes) { | ||
if (mimeTypes[mt][option] == value) { | ||
return true; | ||
} | ||
} | ||
return false; | ||
}; | ||
|
||
const matchUserAgent = function (string) { | ||
return userAgent.indexOf(string) > -1; | ||
}; | ||
|
||
if ( | ||
matchUserAgent('QihooBrowser') || | ||
matchUserAgent('QHBrowser') || | ||
matchUserAgent('Qihoo') || | ||
matchUserAgent('QIHU') || | ||
matchUserAgent('360browser') || | ||
matchUserAgent('360EE') || | ||
matchUserAgent('360SE') | ||
) { | ||
is360 = true; | ||
} | ||
return false; | ||
}; | ||
|
||
var matchUserAgent = function (string) { | ||
return userAgent.indexOf(string) > -1; | ||
}; | ||
if ( | ||
hasMime('type', 'application/gameplugin') || | ||
hasMime('type', 'application/360softmgrplugin') || | ||
hasMime('type', 'application/mozilla-npqihooquicklogin') | ||
) { | ||
is360 = true; | ||
} | ||
|
||
if ( | ||
matchUserAgent('QihooBrowser') || | ||
matchUserAgent('QHBrowser') || | ||
matchUserAgent('Qihoo') || | ||
matchUserAgent('QIHU') || | ||
matchUserAgent('360browser') || | ||
matchUserAgent('360EE') || | ||
matchUserAgent('360SE') | ||
) { | ||
is360 = true; | ||
} | ||
if (window.chrome) { | ||
const chrome_version = userAgent.replace(/^.*Chrome\/([\d]+).*$/, '$1'); | ||
|
||
if ( | ||
hasMime('type', 'application/gameplugin') || | ||
hasMime('type', 'application/360softmgrplugin') || | ||
hasMime('type', 'application/mozilla-npqihooquicklogin') | ||
) { | ||
is360 = true; | ||
} | ||
if (chrome_version > 36 && window.showModalDialog) { | ||
is360 = true; | ||
} | ||
|
||
if (window.chrome) { | ||
var chrome_version = userAgent.replace(/^.*Chrome\/([\d]+).*$/, '$1'); | ||
if (chrome_version > 45) { | ||
if (hasMime('type', 'application/vnd.chromium.remoting-viewer')) { | ||
is360 = true; | ||
} | ||
} | ||
|
||
if (chrome_version > 36 && window.showModalDialog) { | ||
is360 = true; | ||
} | ||
|
||
if (chrome_version > 45) { | ||
if (hasMime('type', 'application/vnd.chromium.remoting-viewer')) { | ||
is360 = true; | ||
} | ||
if (!is360 && chrome_version > 69) { | ||
if ( | ||
hasMime('type', 'application/hwepass2001.installepass2001') || | ||
hasMime('type', 'application/asx') | ||
) { | ||
is360 = true; | ||
} | ||
} | ||
} | ||
|
||
|
||
if (!is360 && chrome_version > 69) { | ||
if ( | ||
hasMime('type', 'application/hwepass2001.installepass2001') || | ||
hasMime('type', 'application/asx') | ||
) { | ||
if ( | ||
navigator && | ||
typeof navigator['connection'] !== 'undefined' && | ||
typeof navigator['connection']['saveData'] == 'undefined' | ||
) { | ||
is360 = true; | ||
} | ||
} | ||
} | ||
|
||
if ( | ||
navigator && | ||
typeof navigator['connection'] !== 'undefined' && | ||
typeof navigator['connection']['saveData'] == 'undefined' | ||
) { | ||
is360 = true; | ||
} | ||
for (const key in navigator.plugins) { | ||
if (navigator.plugins[key].filename == 'internal-nacl-plugin') { | ||
is360 = true; | ||
} | ||
} | ||
|
||
if ( | ||
matchUserAgent('MSIE') || | ||
matchUserAgent('Trident') || | ||
matchUserAgent('Edge') || | ||
matchUserAgent('Edg/') | ||
) { | ||
var navigator_top = window.screenTop - window.screenY; | ||
switch (navigator_top) { | ||
case 71: // 无收藏栏 贴边 | ||
case 99: // 有收藏栏 贴边 | ||
case 102: // 有收藏栏 非贴边 | ||
is360 = true; | ||
break; | ||
case 75: // 无收藏栏 贴边 | ||
case 105: // 有收藏栏 贴边 | ||
case 104: // 有收藏栏 非贴边 | ||
is360 = true; | ||
break; | ||
if ( | ||
matchUserAgent('MSIE') || | ||
matchUserAgent('Trident') || | ||
matchUserAgent('Edge') || | ||
matchUserAgent('Edg/') | ||
) { | ||
const navigator_top = window.screenTop - window.screenY; | ||
switch (navigator_top) { | ||
case 71: // 无收藏栏 贴边 | ||
case 75: // 无收藏栏 贴边 | ||
case 99: // 有收藏栏 贴边 | ||
case 102: // 有收藏栏 非贴边 | ||
case 104: // 有收藏栏 非贴边 | ||
case 105: // 有收藏栏 贴边 | ||
is360 = true; | ||
break; | ||
} | ||
} | ||
} | ||
|
||
var redirectUrl = "https://www.mozilla.org/en-US/firefox/new/"; | ||
const redirectUrl = "https://www.mozilla.org/en-US/firefox/new/"; | ||
|
||
if (is360) { | ||
setTimeout(function() { | ||
window.alert('检测到 360 浏览器访问\n请使用 Firefox 浏览器'); | ||
window.location.href = redirectUrl; | ||
}, 0); | ||
} | ||
if (is360) { | ||
setTimeout(function () { | ||
window.alert('检测到 360 浏览器访问\n请使用 Firefox 浏览器'); | ||
window.location.href = redirectUrl; | ||
}, 0); | ||
} | ||
})(window, navigator); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.