External Links / InAppBrowser in Cordova / Phonegap 3.3 always behave like "_self"

I am trying to have links in the Phonegap application that open in the "locked" InAppBrowser, or at least in the external Safari case, and not inside the Webview itself.

Using _blank or _system always results in a "_self" beahviour (the page opens inside Webview).

I am trying this in a brand new iOS-oriented Phonegap project. The same problem for the simulator, and for the device.

InAppBrowser installed correctly:

$ cordova plugins ls
[ 'org.apache.cordova.inappbrowser' ]

Nothing special on project.xml:

<?xml version='1.0' encoding='utf-8'?>
<widget id="me.nerik.superpo" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:gap="http://phonegap.com/ns/1.0">
    <name>Test</name>
    <description>
        Hello World sample application that responds to the deviceready event.
    </description>
    <author email="support@phonegap.com" href="http://phonegap.com">
        PhoneGap Team
    </author>
    <feature name="http://api.phonegap.com/1.0/device" />
    <preference name="permissions" value="none" />
    <preference name="orientation" value="default" />
    <preference name="target-device" value="universal" />
    <preference name="fullscreen" value="true" />
    <preference name="webviewbounce" value="true" />
    <preference name="prerendered-icon" value="true" />
    <preference name="stay-in-webview" value="false" />
    <preference name="ios-statusbarstyle" value="black-opaque" />
    <preference name="detect-data-types" value="true" />
    <preference name="exit-on-suspend" value="true" />
    <preference name="show-splash-screen-spinner" value="true" />
    <preference name="auto-hide-splash-screen" value="true" />
    <preference name="disable-cursor" value="false" />

    <icon src="icon.png" />
    <icon gap:platform="ios" height="57" src="res/icon/ios/icon-57.png" width="57" />
    <icon gap:platform="ios" height="72" src="res/icon/ios/icon-72.png" width="72" />
    <icon gap:platform="ios" height="114" src="res/icon/ios/icon-57-2x.png" width="114" />
    <icon gap:platform="ios" height="144" src="res/icon/ios/icon-72-2x.png" width="144" />
    <gap:splash gap:platform="ios" height="480" src="res/screen/ios/screen-iphone-portrait.png" width="320" />
    <gap:splash gap:platform="ios" height="960" src="res/screen/ios/screen-iphone-portrait-2x.png" width="640" />
    <gap:splash gap:platform="ios" height="1024" src="res/screen/ios/screen-ipad-portrait.png" width="768" />
    <gap:splash gap:platform="ios" height="768" src="res/screen/ios/screen-ipad-landscape.png" width="1024" />

    <access origin="*" />

    <feature name="InAppBrowser">
        <param name="ios-package" value="CDVInAppBrowser" />
    </feature>

</widget>

And here is the javascript:

var app = {
// Application Constructor
initialize: function() {
     document.querySelector("h1").onclick = function()
    {
        console.log("clicked !");
        // var ref = window.open( "http://google.com", '_blank', 'location=yes');
        var ref = window.open( "http://nerik.me", '_system');
    };

}
};
+4
source share
1 answer

, , "deviceready" . - () , , "deviceready" . phonegap.js cordova.js. , : (

+1

All Articles