I am trying to load iframe with sandbox enabled in my webpage but it is showing error:
An error occured while loading the pad Uncaught SecurityError: Failed to set the 'domain' property on 'Document': Assignment is forbidden for sandboxed iframes.
The code for embedding iframe is:
<iframe
id="iframe1"
name="iframe1"
src="http://localhost:9002/p/6dN6dkWRmd"
height="700px" width="500px"
sandbox="allow-scripts allow-top-navigation">
</iframe>
In the iframe javascript i found that this code is throwing error:
if ((!browser.msie) && (!(browser.mozilla && browser.version.indexOf("1.8.") == 0))) { document.domain = document.domain; // for comet }
Can someone please explain what this document.domain
is doing and what should I do to run this iframe in sandbox environment?
Note: Without sandbox it is working fine.