1

We are developing a cross platform app and facing issues at the uses of iFrame only. Page in iFrame is not loading properly and having issues while scrolling, after some time app is crashing. But app is working fine on android.

Is there any issues related to or specific to the uses of iFrame on iOS?

Code we are using:

<!DOCTYPE html>
<html>
<head>       
    <title></title>   
<meta name="viewport" content="width=device-width, initial-scale=1.0 , minimum-scale=1.0,maximum-scale=1.0, user-scalable=no">  
</head>
<body>
    Test Page
    <iframe src="http://www.devicepixelratio.com/" style="height: 400px;"></iframe>
</body>
</html>

Getting error:

Error Domain=NSURLErrorDomain Code=-999 "The operation couldn’t be completed. (NSURLErrorDomain error -999.)" UserInfo=0x18474b30 {NSErrorFailingURLKey=requested_URL, NSErrorFailingURLStringKey=requested_URL}
Preetam Jadakar
  • 4,479
  • 2
  • 28
  • 58

1 Answers1

0

When I open the website www.devicepixelratio.com in Safari on my Mac and I got the following error message in the debug console:

Blocked a frame with origin "http://googleads.g.doubleclick.net" from accessing a frame with origin "http://www.devicepixelratio.com". Protocols, domains, and ports must match.

This error occurs 9 times every time I load the page. It appears to be an issue with cross domain scripting, which is most likely throwing an error in the UIWebView and causing the crash. I'm not sure what server type you're using, so I won't attempt to help you with the CORS setup, but here's a link to another Stack Overflow question with many answers that may help:

Javascript errors from Google Adsense

Community
  • 1
  • 1
Brian Shamblen
  • 4,653
  • 1
  • 23
  • 37