Telephony opens external links outside the application from the whitelist URL.

I am using Phonegap 2.3 and I am considering updating in the new library. I think this may be a problem that has been fixed with the new library.

Anyway I tried:

window.open('http://google.com','_blank') window.location = "http://google.com"; 

Both were unlucky, forcing the user to upload the external link to safari.

I am also ready for targeting _system , which doesn't work either.

+7
source share
2 answers

There is a config.xml setting that will do the trick:

<preference name="stay-in-webview" value="true" />

Or you can use _system if you enable the InAppBrowser plugin.

<a href="#" onclick="window.open('http://www.nhl.com', '_system', 'location=yes');">_system</a>

InAppBrowser API Document

Here are a couple of related threads:

https://build.phonegap.com/docs/config-xml (search through the stay-in-webview pages)

Phonegap build: how to open external url in android device browser?

+3
source

For Phonegap 3, you must install the InAppBrowser plugin , and then run:

 window.open("http://google.com", "_system"); 
+1
source

All Articles