简体   繁体   中英

Is there a way to detect Safari in this state with JavaScript?

Is it possible to detect with JavaScript when safari on iOS has been opened from an app and is showing this type of UI? You can get here on iOS 12 by opening a link from the gmail app using safari.

Update: To be clear I'm looking to find when the chrome of safari is in the state pictured in the image, and not the state that the safari app normally launches in 在此处输入图片说明

From: How to detect Safari, Chrome, IE, Firefox and Opera browser?

        var isSafari = /constructor/i.test(window.HTMLElement) || (function (p) { 
        return p.toString() === "[object SafariRemoteNotification]"; }) 
         (!window['safari'] || (typeof safari !== 'undefined' && 
        safari.pushNotification));

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM