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
The most trustable way we found to tell if we are in a cordova/phonegap application is to modify the cordova application's user agent using this config AppendUserAgent.
In config.xml add:
Then call:
var isCordova = navigator.userAgent.match(/Cordova/i))
Why?
window.cordova and document.addEventListener('deviceready', function(){}); are subject to racing conditions navigator.standalone does not work when is a website (Ex: or with cordova-plugin-remote-injection)