Created
March 28, 2018 08:49
-
-
Save tsmd/6075ad31f96655de53b9b13cc90bd248 to your computer and use it in GitHub Desktop.
Detect if the app is executed from the home screen
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function isStandalone () { | |
if ('standalone' in window.navigator) { | |
return window.navigator.standalone | |
} else { | |
return window.matchMedia('(display-mode: standalone)').matches | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment