Closed ngyikp closed 6 years ago
I'm getting the same issue.
https://github.com/tulios/json-viewer/pull/209. If @tulios doesn't merge it soon, I'm switching too.
The Chrome bug has been reported by someone else, and fixed in Chrome 68 :) https://bugs.chromium.org/p/chromium/issues/detail?id=811528
Reproduction URLs:
Both of these URLs have a response header of
Content-Security-Policy: sandbox
Tested on user-agents:
Expected result: The JSON viewer should work.
Actual result: Doesn't work at all, page is completely blank, and a console error appears:
Blocked script execution in 'https://untitled-8bobienkqieg.runkit.sh/' because the document's frame is sandboxed and the 'allow-scripts' permission is not set.
It's a misleading error, the extension's content script does run but halts at one point. I did some investigation and it might be a Chrome bug,
setTimeout
andsetInterval
doesn't work in the sandbox CSP, butrequestAnimationFrame
orrequestIdleCallback
works.I tried this patch and it works, there's still some buggy behaviour but at least it's not a white screen anymore.
Another thing with(replaced with https://github.com/tulios/json-viewer/issues/210)requestAnimationFrame
is that only Chrome 24+ has the unprefixed version and the manifest's minimum Chrome version is 21, but I think no one should be using an ancient Chrome anymore :)