Phonegap Android: How to open whitelisted domain urls in a new browser window?
android, cordova, whitelist
Solution
There are two ways to do this:
- Use `navigator.app.loadUrl("http://www.example.com/index.html", {openExternal: true});`
- Use the ChildBrowser Plugin and it's openExternal command.
Problem
I am developing a iOs & Android App with Cordova 1.9 + JQM. The app reads data from JSON services in "www.example.com", so I have this domain whitelisted in cordova.xml The problem is I need to open some URL pointing to www.example.com in a new browser window, outside the app. I tried these: ``` <a href="#" onclick="navigator.app.loadUrl('http://www.example.com/external')" class="ui-link" rel="external" target="_blank">external</a> <a href="#" onclick="window.open('http://www.example.com/externa')" class="ui-link" rel="external" target="_blank">external</a> <a href="http://www.example.com/external" class="ui-link" rel="external" target="_blank">external</a> ``` ...but all of them open the new window inside the webView, not in a native browser new window. I made this work in iOS but can't see the solution for Android. Any help would be appreciated. thanks!!