I\'m developing a web application that uses PhoneGap:Build for a mobile version and want to have a single codebase for the \'desktop\' and mobile versions. I want to be able
This seems to be viable and I have used it in production:
if (document.location.protocol == "file:") {
// file protocol indicates phonegap
document.addEventListener("deviceready", function() { $(initInternal);} , false);
}
else {
// no phonegap, start initialisation immediately
$(initInternal);
}
Source: http://tqcblog.com/2012/05/09/detecting-phonegap-cordova-on-startup/