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

Tel and Mailto links don't work in iframe

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.5.0
    • 3.7.0
    • cordova-ios
    • Tested on iPhone 4s running iOS 7

    Description

      Tel and Mailto hyperlinks don't work if contained in an iframe.
      The cause of this issue is this line of code: GitHub.
      It seems that

      [NSURLConnection canHandleRequest:request]

      returns false in this case causing the links to not function.

      Example App:

      app.html
      <!DOCTYPE html>
      <html>
          <head>
              <meta charset="utf-8"/>
              <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no"/>
          </head>
          <body>
              <a href="tel:041245">Top Level Tel</a>
              <a href="mailto:example@example.com">Top Level Mailto</a>
              <iframe src="iframe.html"></iframe>
              <script type="text/javascript" src="cordova.js"></script>
          </body>
      </html>
      
      iframe.html
      <!DOCTYPE html>
      <html>
          <head>
              <meta charset="utf-8"/>
              <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no"/>
          </head>
          <body>
              <a href="tel:041245">iFrame Tel</a>
              <a href="mailto:example@example.com">iFrame Mailto</a>
          </body>
      </html>
      

      Attachments

        Activity

          People

            shazron Shazron Abdullah
            NathanSmith Nathan Smith
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: