4 Replies Latest reply on Aug 11, 2016 1:29 PM by dogofpavlov

    links inside an iframe with target "_blank" open inside iframe IOS only.

    dogofpavlov Level 1

      Hello,

       

      I have a simple app that has an iFrame that shows a website. Some of the links on this website have target="_blank". But on iOS only, when I click the links in the iframe, they open INSIDE the iframe and not in the native browser (Safari). On Android it's fine and opens in the native browser. And since my app is literally just an iframe, there is is no back button so as soon as someone clicks 1 of these target="_blank" links, they essentially become stuck and have to close the app and reopen.

       

      What I find EXTREMELY interesting is it seems like most people are having the OPPOSITE problem (go figure): cordova - Why are links inside an iFrame opening in system safari? - Stack Overflow  (and this was posted 4 months ago).

       

      I'm a PhoneGap Noob, so maybe I'm missing something obvious. I'm using PhoneGap Build to compile my app... so I cant modify any of the ios ".m" files (or maybe Im confused about this).

      PhoneGap (iOS / Android / Windows)
      cli-5.2.0 (3.9.1 / 4.1.1 / 3.8.1)

       

      here are some of the details from my config.xml:

       

        <content src="index.html"/>

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

        <access origin="*"/>

        <allow-intent href="http://*/*"/>

        <allow-intent href="https://*/*"/>

        <allow-intent href="tel:*"/>

        <allow-intent href="sms:*"/>

        <allow-intent href="mailto:*"/>

        <allow-intent href="geo:*"/>

        <platform name="android">

          <allow-intent href="market:*"/>

        </platform>

        <platform name="ios">

          <allow-intent href="itms:*"/>

          <allow-intent href="itms-apps:*"/>

        </platform>

       

       

      And here is my index.html

       

      <!DOCTYPE html>

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

          <script type="text/javascript" src="js/jquery.min.js"></script>

          <link rel="stylesheet" type="text/css" href="css/index.css" />

          <title>Act Mobile</title>

      </head>

      <body>

          <div class="app">

              <script type="text/javascript" src="cordova.js"></script>

              <script type="text/javascript" src="js/index.js"></script>

              <script type="text/javascript">

                  app.initialize();

              </script>

              <iframe id="webview" src="https://mycloud.act.com"></iframe

          </div>

      </body>

      </html>