简体   繁体   中英

Iframe current src with a redirection from a different domain to same domain

I have a page from a.com which includes a iframe from b.com and after some manipulation b.com finally redirects iframe back to a.com. So can the page access the current location/src of the iframe?

Regards,

Jishnu

Once the page in the iframe is on a.com, the security restrictions are lifted and you can access the parent page like normal. Security restrictions are updated when the iframe src is changed, even if it is by the iframe itself.

If you need to know when the iframe has finally directed back to a.com, you can have it call a function in the parent document with window.parent.redirected() where redirected() is a function you define in the parent document on a.com.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM