I have a Phonegap (cordova) application where I want to load some external webpages within the phonegap WebView and I have other external webpages that I want to load in saf
The right way of doing this is using the inAppBrowser plugin
install it using the cordova CLI:
cordova plugin add org.apache.cordova.inappbrowser
Then, to open a link on safari just use:
window.open('http://apache.org', '_system');
There is a newer version of the plugin hosted on npm
to install it from the cordova CLI:
cordova plugin add cordova-plugin-inappbrowser
To open the website on safari you can use
cordova.InAppBrowser.open('http://apache.org', '_system');
or, if you want to continue using window.open like the older version you can just do this on device ready event:
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
window.open = cordova.InAppBrowser.open;
}