I spent hours to find out how to do it. And believe me or not, I found nothing on the whole internet about how to solve it. Actually there is a simple way to do that after the event “deviceready” has been triggered (as described on the PhoneGap’s API Docs), it is simple as: The “deviceready” trigger, tell us when all native components are loaded and ready to use. Which means, that there is no way to determine whether the page loaded from PhoneGap or not using the PhoneGap plugin itself. You can check the UserAgent, but it is not always true, because it is possible to open the page through the mobile’s browser which is the same UserAgent as loaded from PhoneGap. Let’s give a typical example, that describes the case better. Let’s say I want to perform an action when the device is ready and the document is…

Read more

1/1