Created
April 4, 2017 11:15
-
-
Save vpotap/9b27b6e0f66bbba4fb9ce204213ed2cb to your computer and use it in GitHub Desktop.
phonegup
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
/** | |
* Determine whether the file loaded from PhoneGap or not | |
*/ | |
function isPhoneGap() { | |
return (window.cordova || window.PhoneGap || window.phonegap) | |
&& /^file:\/{3}[^\/]/i.test(window.location.href) | |
&& /ios|iphone|ipod|ipad|android/i.test(navigator.userAgent); | |
} | |
window.isMobileApp = !!isPhoneGap(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment