Skip to content

Instantly share code, notes, and snippets.

Created Aug 21, 2014
What would you like to do?
Detecting Cordova with user agents
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