PhoneGap Build: how to open external url in device browser on Android?

Joan picture Joan · Mar 20, 2013 · Viewed 64k times · Source

External URL's don't open in the system's browser in my PhoneGap Android application. I'm using PhoneGap Build 2.3.0.

According to the Cordova documentation I used target '_system':

window.open('http://www.myurl.nl', '_system');

In my config.xml I have:

<plugin name="InAppBrowser" value="org.apache.cordova.InAppBrowser" />
<access origin="*" browserOnly="true" />

But still the links open in my apps webview.

How to solve this?

Answer

Joan picture Joan · Apr 23, 2013

It's not the answer when you want to keep using PhoneGap Build, but I solved the problem by setting up a development environment for Cordova (PhoneGap) on my machine and compiling the app locally. In Cordova 2.5.0 window.open('http://www.myurl.nl', '_system'); works perfect, it will open the link in the system's browser.

So my advice is to stop using PhoneGap Build and start compiling your app locally. Here's how to set up your development environment for Cordova >>