This is my first post so don't trash me if it doesn't work, but this fix seems to work for me in IE.
Add security="restricted" to your frame.
example:
<iframe id="frame_id" name="frame_name" security="restricted" src="page.html">
</iframe>
Edit: I found a better solution. That doesn't block scripts and doesn't require javascript. Try using sandbox="..."
- allow-forms allows form submission
- allow-popups allows popups
- allow-pointer-lock allows pointer lock
- allow-same-origin allows the document to maintain its origin
- allow-scripts allows JavaScript execution, and also allows features to trigger automatically
- allow-top-navigation allows the document to break out of the frame by navigating the top-level window
Top navigation is what you want to prevent, so leave that out and it will not be allowed. Anything left out will be blocked
ex.
<iframe sandbox="allow-same-origin allow-scripts allow-popups allow-forms" src="http://www.example.com"></iframe>
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…