diff options
-rw-r--r-- | web/share/js/tools.js | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/web/share/js/tools.js b/web/share/js/tools.js index 59b8ba13..49a3f8c8 100644 --- a/web/share/js/tools.js +++ b/web/share/js/tools.js @@ -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+ |