Created
April 30, 2018 17:21
-
-
Save opencoca/155a443aa0507961669d9079bbc5684a to your computer and use it in GitHub Desktop.
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
var standalone = window.navigator.standalone, | |
userAgent = window.navigator.userAgent.toLowerCase(), | |
safari = /safari/.test( userAgent ), | |
ios = /iphone|ipod|ipad/.test( userAgent ); | |
if( ios ) { | |
if ( !standalone && safari ) { | |
//browser | |
} else if ( standalone && !safari ) { | |
//standalone | |
} else if ( !standalone && !safari ) { | |
//uiwebview | |
}; | |
} else { | |
//not iOS | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment