2 Replies Latest reply on Dec 21, 2016 12:06 AM by Dev Adelya

    Phonegap 6.4.2 iframe on iOS10 not loading

    Dev Adelya

      Hi,

       

      I recently found a bug on my phonegap application. So, I decided to correct it (nice!) and I needed to update phonegap client to the new version 6.4.2. Once done, I ran my application via "phonegap serve" and test my app on Android device and an iPhone device (with iOS 10). Our application is a simple HTML page with an iframe inside in order to encapsulate our responsive design website.

       

      Everything works great on Android but on the iPhone, the iframe doesn't load !!! I search for a long time why... I do not understand...

       

      So, I planned to create a new application

      phonegap create TestApp

      Here is the index.html code

       

      <html>
      <head>
          <meta charset="utf-8" />
          <meta name="format-detection" content="telephone=no" />
          <meta name="msapplication-tap-highlight" content="no" />
          <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width" />
          <meta http-equiv="Content-Security-Policy" content="default-src gap://ready file://* *; style-src * 'unsafe-inline'; script-src * 'unsafe-inline' 'unsafe-eval'; frame-src *; ">
      
          <link rel="stylesheet" type="text/css" href="css/index.css" />
          <script type="text/javascript" src="js/index.js"></script>
          <script type="text/javascript" src="js/jquery-1.7.1.min.js"></script>
          <title>Hello World</title>
      </head>
      <body>
          <iframe id="webview" src="https://www.google.com" onload="checkPage();">
          </iframe>
          <script type="text/javascript" src="cordova.js"></script>
          <script type="text/javascript">
              app.initialize();
          </script>
           </body>
      </html>
      

       

      It's really the started page with an iframe inside and this iframe doesn't load and the checkPage() is never fired. I tried to change "Content-Security-Policy" but... did not work...

      I'm out of ideas, so, if somebody had the same issue and know how to resolve this... You're welcome !

       

      Thanks, I can provide you more code if you want

       

      Laurent

        • 1. Re: Phonegap 6.4.2 iframe on iOS10 not loading
          kerrishotts Adobe Community Professional

          What does your config.xml look like (minus identifying/secret information)? You need to make sure to add your iframe's domain to the allow-navigation tag in your config.xml's whitelist. See Whitelist - Apache Cordova

          • 2. Re: Phonegap 6.4.2 iframe on iOS10 not loading
            Dev Adelya Level 1

            I tried a lot of things.

            Here is my current config.xml

                <access origin="*" allows-arbitrary-loads-in-media="true" allows-arbitrary-loads-in-web-content="true" allows-local-networking="true" />

                <allow-intent href="*" />

                <allow-navigation href="*" />

               

                <preference name="phonegap-version" value="cli-5.2.0" />

                <plugin name="cordova-plugin-whitelist" source="npm" spec="~1.2.1" />

             

            Yes, I tried to target an old phonegap client in order to have Phonegap Build works...

            Tell me if you want to see the full config.xml, but I think this is this part which interest you