2 Replies Latest reply on May 15, 2018 12:19 AM by konstantinkhlopin

    External URL navigation does not work in PhoneGap web app on iOS 11.3 Beta

    konstantinkhlopin

      Navigation to external URL from my PhoneGap web app stopped working on iOS 11.3 Beta version on iPad. It is working fine on iOS 11.2.5 and on Android platform.

      It looks like the reason for this is that iOS 11.3 takes Safari 11.1 into use, which in turn has some security changes that might affect this navigation (see Safari 11.1).

      Note that the same problem initially existed on iOS 10 about a year ago, but then it has been fixed by adding <allow-navigation href="*" /> to config.xml of the app.

      Naturally my app still has this setting. The external navigation itself is happening when submitting a form with an external URL to the frame in the following manner:

      ...

      <script type="text/javascript">

           ...

           document.getElementById("url").value = ...;

           document.getElementById("form").submit();

           ...

      </script>

      ...

      <form id="form" action="frame.html" method="GET">

            <input id="url" type="hidden" name="url"/>

           ...

      </form>

      ...

      frame.html:

      ...

      <script type="text/javascript">

           function loadPage() {

                var url = new URL(window.location.href).searchParams.get("url");

                ...

                document.getElementById("frame").src = url;

           }

           ...

      </script>

      ...

      <body onload="loadPage()">

           <iframe id="frame" src="#" ></iframe>

           ...

      </body>