mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2025-12-13 09:40:30 +08:00
improved apple detection
This commit is contained in:
parent
125baff0cb
commit
60c729980f
@ -302,9 +302,15 @@ export var tools = new function() {
|
|||||||
let is_firefox = (typeof InstallTrigger !== "undefined");
|
let is_firefox = (typeof InstallTrigger !== "undefined");
|
||||||
|
|
||||||
// Safari 3.0+ "[object HTMLElementConstructor]"
|
// Safari 3.0+ "[object HTMLElementConstructor]"
|
||||||
let is_safari = (/constructor/i.test(window.HTMLElement) || (function (p) {
|
let is_safari = (function() {
|
||||||
return p.toString() === "[object SafariRemoteNotification]";
|
if (/constructor/i.test(String(window["HTMLElement"]))) {
|
||||||
})(!window["safari"] || (typeof safari !== "undefined" && safari.pushNotification))); // eslint-disable-line no-undef
|
return true;
|
||||||
|
}
|
||||||
|
if (!window.top["safari"]) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return String(window.top["safari"].pushNotification) === "[object SafariRemoteNotification]";
|
||||||
|
})();
|
||||||
|
|
||||||
// Chrome 1+
|
// Chrome 1+
|
||||||
let is_chrome = !!window.chrome;
|
let is_chrome = !!window.chrome;
|
||||||
@ -314,7 +320,11 @@ export var tools = new function() {
|
|||||||
|
|
||||||
// iOS browsers
|
// iOS browsers
|
||||||
// https://stackoverflow.com/questions/9038625/detect-if-device-is-ios
|
// https://stackoverflow.com/questions/9038625/detect-if-device-is-ios
|
||||||
let is_ios = (!!navigator.platform && /iPad|iPhone|iPod/.test(navigator.platform));
|
// https://github.com/lancedikson/bowser/issues/329
|
||||||
|
let is_ios = (!!navigator.platform && (
|
||||||
|
/iPad|iPhone|iPod/.test(navigator.platform)
|
||||||
|
|| (navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1 && !window["MSStream"])
|
||||||
|
));
|
||||||
|
|
||||||
// Any browser on Mac
|
// Any browser on Mac
|
||||||
let is_mac = ((
|
let is_mac = ((
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user