Phonegap HTML app and various alerts hang browser

Solution 1:

If you're testing your app in your desktop browser, you can simply exclude the file. For Chrome:

<script type="text/javascript">
    if (!navigator.userAgent.toLowerCase().match('chrome')) {
        document.write("<script src='phonegap.js'><\/script>");
    }
</script>

(This way you don't have to remember to uncomment the script link for your build process.)

Solution 2:

Those alerts normally show up when you have the wrong cordova.js file included. There are different ones for each platform. Make sure that you havn't for example copied the android one into your ios build.

Solution 3:

You just need to comment out this line on cordova.js :

return prompt(argsJson, 'gap:'+JSON.stringify([service, action, callbackId]));

which is on line 4184 when using Phonegap 2.9.0-0 (Android)

Uncomment before deploying to the device for production