You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "Dan van Leeuwen (JIRA)" <ji...@apache.org> on 2015/11/03 17:22:27 UTC
[jira] [Commented] (CB-9573) window.open(url,"_self") for
whitelisted url opens InAppBrowser instead of updating current WebView in
Android
[ https://issues.apache.org/jira/browse/CB-9573?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14987546#comment-14987546 ]
Dan van Leeuwen commented on CB-9573:
-------------------------------------
I was trying something similar and it worked for me after I added the following in the config.xml file.
<allow-navigation href="http://www.google.fr/*">
or perhaps
<allow-navigation href="*">
See also
https://github.com/apache/cordova-plugin-whitelist
Note, I do not know why adding allow-navigation is not required on iOS.
The versions I am using are CLI 5.3.3, android 4.1.1 and ios 3.9.1
cordova-plugin-whitelist 1.0.0
> window.open(url,"_self") for whitelisted url opens InAppBrowser instead of updating current WebView in Android
> --------------------------------------------------------------------------------------------------------------
>
> Key: CB-9573
> URL: https://issues.apache.org/jira/browse/CB-9573
> Project: Apache Cordova
> Issue Type: Bug
> Components: Android, Plugin InAppBrowser
> Affects Versions: 5.1.1
> Reporter: Sebastien Lorber
>
> I use
> - CLI 5.1.1
> - Android platform 4.0.2
> - InAppBrowser 1.0.1
> - Crosswalk plugin 1.2.0
> My config.xml contains:
> {code}
> <access origin="http://*" />
> <access origin="https://*" />
> <access launch-external="yes" origin="tel:*" />
> <access launch-external="yes" origin="geo:*" />
> <access launch-external="yes" origin="mailto:*" />
> <access launch-external="yes" origin="sms:*" />
> <access launch-external="yes" origin="market:*" />
> <allow-intent href="*" />
> {code}
> Then I run the following code when the app starts:
> {code}
> function deviceReady() {
> window.open("http://www.google.fr","_self");
> }
> document.addEventListener('deviceready', deviceReady, false);
> {code}
> It opens the InAppBrowser instead of making the WebView navigate to the url. It is not the expected behavior according to the doc:
> bq. _self: Opens in the Cordova WebView if the URL is in the white list, otherwise it opens in the InAppBrowser.
> If this time I remove the InAppBrowser proxy/wrapper (like mentionned in the doc):
> {code}
> function deviceReady() {
> delete window.open;
> window.open("http://www.google.fr","_self");
> }
> document.addEventListener('deviceready', deviceReady, false);
> {code}
> Then it opens the url in the system browser (not sure this is expected either right? but maybe it's Android / Crosswalk webview default anyway...)
> Notice that I absolutly don't want to use in any way the InAppBrowser, I just only need to be able in some cases to use the _system target, that is made available by the InAppBrowser
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org