Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-9573

window.open(url,"_self") for whitelisted url opens InAppBrowser instead of updating current WebView in Android

    XMLWordPrintableJSON

Details

    Description

      I use

      • CLI 5.1.1
      • Android platform 4.0.2
      • InAppBrowser 1.0.1
      • Crosswalk plugin 1.2.0

      My config.xml contains:

          <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="*" />
      

      Then I run the following code when the app starts:

      function deviceReady() {
          window.open("http://www.google.fr","_self");
      }
      document.addEventListener('deviceready', deviceReady, false);
      

      It opens the InAppBrowser instead of making the WebView navigate to the url. It is not the expected behavior according to the doc:

      _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):

      function deviceReady() {
          delete window.open;
          window.open("http://www.google.fr","_self");
      }
      document.addEventListener('deviceready', deviceReady, false);
      

      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

      Attachments

        Activity

          People

            Unassigned Unassigned
            sebastienlorber Sebastien Lorber
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: