Temp O'rary
Temp O'rary

Reputation: 5826

Phonegap: Open a URL in default browser

How to open a URL in default browser in android?

I've tried <a href="#" onclick="window.open('http://www.google.com', '_system');">www.google.com</a> but it opens up in the same app window, but I want it to open up in a default browser's window.

Upvotes: 0

Views: 1543

Answers (2)

Aravin
Aravin

Reputation: 4108

Make sure you added the in app browser plugin. Please check it in your config.xml file(It is in your res/xml/config.xml) the following line is present.

<plugin name="InAppBrowser" value="org.apache.cordova.InAppBrowser" />

Like the following you can add the plugin:

phonegap local plugin add your plugin url here

And also chances may be there if you are using phonegap build the in app browser is open instead of default system browser(even though you are using _system).

For more details refer this Stack overflow answer

Upvotes: 2

Adarsh Nahar
Adarsh Nahar

Reputation: 319

You need to install inappbrowser plugin in your app like this

cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser.git

after successful install the above code will start working.

Upvotes: -1

Related Questions