0

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 enter image description here

BrianBest
  • 63
  • 1
  • 7

1 Answers1

0

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));
Damien
  • 13
  • 3
  • Sorry, I wasn't clear JJ, I can detect Safari, but I need to find if the site has been opened in a certain way. I've updated my question to be more clear – BrianBest Oct 01 '18 at 22:26
  • Ahh i see the problem here is that it will always detect safari perhaps you can try and use the reffer url ( the link you got redirected from) for ex: gmail? – Damien Oct 01 '18 at 22:29
  • That's a good idea, but in testing, it didn't work out :( using `document.referrer;` just gives me the current URL. https://codepen.io/brianbest/pen/NOGqMg – BrianBest Oct 01 '18 at 22:36