Sometimes PhoneGap opens web pages in the Android browser, sometimes it opens them in its UIWebView. The behavior varies from version to version of Android. For example, in ICS window.open() opens links in the Android browser, but the 2.3 emulator opens such links in the WebView.
What controls whether the link is opened in the Android browser or in the WebView?
What I’ve found so far:
Things that fire the
shouldOverrideUrlLoadingmethod will launch an external browser if:sms:,tel:,geo:,mailto:)But, the
shouldOverrideUrlLoadingmethod is not always fired — on Android 2.2 and previous (and maybe 2.3?) Javascript techniques to trigger a page load (such aswindow.open()ordocument.location.href =) do not fire the method, and therefore load in the WebView regardless.Links physically clicked by the user seem to always fire the method. Using the JS event mechanism to fire a click event on a link may also work, I haven’t tried it.