Home Redirect parent page from iframe in iOS
Reply: 0

Redirect parent page from iframe in iOS

user884 Published in May 24, 2018, 3:52 pm

I'm embedding an iFrame to an external payment-provider, after the user completes their step the user gets redirected to my domain. I'm now trying to redirect the parent page to another page located on my domain like so:

iFrame embedded on mydomain.com

<iframe src="example.com/payment" sandbox="allow-top-navigation allow-forms allow-scripts"></iframe>

Code to redirect the parent page

window.top.location.href = "mydomain.com";

On Safari in iOS I'm now getting: SecurityError: DOM Exception 18: An attempt was made to break through the security policy of the user agent.

Is this the expected behavior even though I used allow-top-navigation in my sandbox parameter? If so, are there any existing workarounds?

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.393968 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO