I assume you are using Cordova/PhoneGap?! I was not able to figure out how to force opening links in the external browser. One workaround is to limit the white list only to those URLs where you need to fetch data from (you should do that anyway). All URLs not on the white list will be opened in the external browser. If more than one is installed, the user has to choose the preferred browser.
Yes I am using Cordova 2.1.0, Data is coming from n number of URLs, Some are dynamic. I cannot list all to the whitelist, I gave "*" in the config.xml.
You should not list them on your white list, but you currently do as * will match every URL. Remove the * and only add URLs in your config.xml where you need to fetch data from (via Ajax or Cordova file API).
Thank you, that is really helpful. It is a pity, that it is not in the docs. I used the white list workaround so far, but to open the URLs explicitly external is far better.
What I found after doing so much R & D on google is Whitelisting in android and iOS is different, I put '*" for iOS and give domain name from where my data is coming in Android for example "*.example.com" .
Comments
Is there any way we can do this?
navigator.app.loadUrl("http://www.example.com/", { openExternal: true });
Its not in the API docs, but is documented in the js file:
https://github.com/apache/incubator-cordova-android/blob/master/framework/assets/js/cordova.android.js#L3843
(At least with Cordova 2.2)
This is working for me.