Skip to content

Instantly share code, notes, and snippets.

@ktopping
Created May 23, 2012 14:03
Show Gist options
  • Save ktopping/2775401 to your computer and use it in GitHub Desktop.
Save ktopping/2775401 to your computer and use it in GitHub Desktop.
is standalone?
// Thanks to http://cubiq.org/add-to-home-screen
var isSafari = navigator.appVersion.match(/Safari/gi);
var isStandalone = navigator.standalone;
// Earlier I had been labouring with:
var isStandalone = navigator.userAgent.match(/WebKit.*Mobile/) && !navigator.userAgent.match(/Safari/);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment