Skip to content

Instantly share code, notes, and snippets.

@tsmd
Created March 28, 2018 08:49
Show Gist options
  • Save tsmd/6075ad31f96655de53b9b13cc90bd248 to your computer and use it in GitHub Desktop.
Save tsmd/6075ad31f96655de53b9b13cc90bd248 to your computer and use it in GitHub Desktop.
Detect if the app is executed from the home screen
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