handle is_safari in iframe

This commit is contained in:
Maxim Devaev 2022-04-26 03:16:00 +03:00
parent 10b8215f4e
commit 720299e386

View File

@ -353,10 +353,17 @@ export var tools = new function() {
if (/constructor/i.test(String(window["HTMLElement"]))) { if (/constructor/i.test(String(window["HTMLElement"]))) {
return true; return true;
} }
if (!window.top["safari"]) { let push = null;
return false; 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+ // Chrome 1+