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 === window.top
The case is that the app that I want to embed in an iframe has many references to window.top, it stores objects and uses them to communicate back and forth with its own child iframes.
<iframe sandbox=""></iframe>
Without "allow-scripts" is not an option for me as any access to window.top throws and Error, while I want things to work pretty much as if the iframe was a top level window
Note: I saw a similar question asked How to Trick/Fool an Iframe to thinking its the TOP element in DOM but there while the same requirement, the actual problem - changing the top.location could be worked-around, this is why I guess the discussion was discontinued.