Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firefox not loading iframe content

I have a page at http://localhost/page1 and On that page i am showing http://localhost/page2 content in an iframe in some div.

It works fine in chrome. However in firefox, page2 does not show up.
I don't get any warnings/error in firefox console.

Since both the pages have same domain. firefox should correctly load page2 iframe

Am i missing something obvious?

like image 865
harrybvp Avatar asked Sep 21 '26 01:09

harrybvp


1 Answers

It is purposefully loads an empty iframe. This happens in Firefox to prevent infinite recursion.

According to the W3C specification on frames:

Infinite recursion is prevented. Any frame that attempts to assign as its SRC a URL used by any of its ancestors is treated as if it has no SRC URL at all (basically a blank frame). This doesn't prevent all malicious documents, but it eliminates a troublesome class of them.

Please see the attached stackoverflow article - this is where I found the answer.

Infinite recursion

like image 166
Jan Swart Avatar answered Sep 22 '26 21:09

Jan Swart



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!