mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2025-12-12 01:00:29 +08:00
handle is_safari in iframe
This commit is contained in:
parent
10b8215f4e
commit
720299e386
@ -348,15 +348,22 @@ export var tools = new function() {
|
||||
// Firefox 1.0+
|
||||
let is_firefox = (typeof InstallTrigger !== "undefined");
|
||||
|
||||
// Safari 3.0+ "[object HTMLElementConstructor]"
|
||||
// Safari 3.0+ "[object HTMLElementConstructor]"
|
||||
let is_safari = (function() {
|
||||
if (/constructor/i.test(String(window["HTMLElement"]))) {
|
||||
return true;
|
||||
}
|
||||
if (!window.top["safari"]) {
|
||||
return false;
|
||||
let push = null;
|
||||
try {
|
||||
push = window.top["safari"].pushNotification;
|
||||
} catch {
|
||||
try {
|
||||
push = window["safari"].pushNotification;
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return String(window.top["safari"].pushNotification) === "[object SafariRemoteNotification]";
|
||||
return String(push) === "[object SafariRemoteNotification]";
|
||||
})();
|
||||
|
||||
// Chrome 1+
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user