Skip to content Skip to sidebar Skip to footer

How To Fool Iframe That It Is Top Most Window

I wonder, is there a way to override the iframe's window.top and window.parent such that from it's context the following is true window === window.parent && window === win

Solution 1:

The simple answer is no you can not change a read-only property.

The more complex answer is that you could parse the other site through a proxy server and dynamically rewrite the JS. However I strongly expect that is more effort than it is worth and will likely break copyright laws at some point.

The question you should be asking is does the third-party want to be in your iFrame? If yes get them to fix their code, if no then you shouldn't be doing this.

Post a Comment for "How To Fool Iframe That It Is Top Most Window"