"...document's frame is sandboxed and the 'allow-scripts' permission is not set"
See original GitHub issueReport
Using CSScritics, I get the error :
Blocked script execution in ‘http://solar-druid.codio.io/tests/csscritic.html’ because the document’s frame is sandboxed and the ‘allow-scripts’ permission is not set. . h.1.e.calculateDocumentContentSize @ rasterizeHTML.allinone.js:12 . h.1.f.drawDocumentAsSvg @ rasterizeHTML.allinone.js:12 . h.1.k @ rasterizeHTML.allinone.js:12 . (anonymous function) @ rasterizeHTML.allinone.js:12 . (anonymous function) @ rasterizeHTML.allinone.js:12
Resolution hints
Fortunately, Stackoverflow helps. See Why am I getting a blocked script execution error?
This error message (introduced here) is displayed when an
<iframe>
element withsandbox
attribute is attempting to run JavaScript (only allowed whenallow-scripts
is specified in that attribute). A look at the rasterizeHTML source code shows that the function createHiddenSandboxedIFrame() creates such a frame. It is used forcalculateDocumentContentSize()
, the contents of the document are being copied into the temporary sandboxed frame in order to measure their size. Apparently, that document also contains some<script>
tags and these cause the error (not because of the script origin but because scripts are generally disallowed).
Reproduce bug
I got this bug using Chromium 45.0.2454.101 Ubuntu 15.04 (64-bit), upon ./test/csscritic.html.
The tested page is ./index.html. There is what you should see if all right (on first connexion) :
(+ Hi Christopher, long time not seen !)
Issue Analytics
- State:
- Created 8 years ago
- Comments:12 (5 by maintainers)
Top GitHub Comments
Change iframe.sandbox = ‘allow-same-origin’;
for
iframe.sandbox = ‘allow-same-origin allow-scripts allow-popups allow-forms’;
in src/browser.js
I cannot provide full example, but i can share relevant parts