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
GeorgeW's solution is OK, but even on real device, PhoneGap.available is only true after PhoneGap's things has been loaded, e.g. onDeviceReady in document.addEventListener('deviceready', onDeviceReady, false) has been called.
Before that time, if you want to know, you can do like this:
runningInPcBrowser =
navigator.userAgent.indexOf('Chrome') >= 0 ||
navigator.userAgent.indexOf('Firefox') >= 0
This solution assumes that most developers develop using Chrome or Firefox.