Question

Is there is way to know in JavaScript, if the user has loaded the website from homescreen after doing add to home screen or is he browsing normally via safari .

Was it helpful?

Solution 2

Safari has a way...

if (window.navigator.standalone) {
    // From home screen

}

OTHER TIPS

You can use document.referrer to see where the user came from. But only if the user allows submit of referrer in his browser.

When the URL comes from a bookmark (supposed that home screen is the same as bookmark) the referrer is empty. So this would be a hint, not more.

Other than that there is no way to see where the user came from.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top