-
-
Save videlais/98058eebd810f9705314 to your computer and use it in GitHub Desktop.
Detecting Cordova with user agents
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
if (navigator.userAgent.match(/(iPhone|iPod|iPad|Android|BlackBerry|IEMobile)/)) { | |
document.addEventListener("deviceready", onDeviceReady, false); | |
} else { | |
onDeviceReady(); //this is the browser | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment