How to determine if browser or app

Hmm, with the WKWebView my above workaround doesn’t work anymore as ios uses http://localhost:8080 to serve from.

So the less nice thing can still be done like this

this.isApp = (!document.URL.startsWith('http') || document.URL.startsWith('http://localhost:8080'));

It works so long as your local ionic serve doesn’t use the same port :slight_smile:

7 Likes