Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't work on JSON endpoints with sandbox CSP #178

Closed
ngyikp opened this issue Oct 29, 2017 · 3 comments
Closed

Doesn't work on JSON endpoints with sandbox CSP #178

ngyikp opened this issue Oct 29, 2017 · 3 comments
Labels

Comments

@ngyikp
Copy link

ngyikp commented Oct 29, 2017

Reproduction URLs:

Both of these URLs have a response header of Content-Security-Policy: sandbox

Tested on user-agents:

  • Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.75 Safari/537.36
  • Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3252.0 Safari/537.36

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 and setInterval doesn't work in the sandbox CSP, but requestAnimationFrame or requestIdleCallback 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 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 :) (replaced with #210)

@psyrendust
Copy link

I'm getting the same issue.

@VladimirAlexiev
Copy link
Contributor

#209. If @tulios doesn't merge it soon, I'm switching too.

@ngyikp
Copy link
Author

ngyikp commented Jul 22, 2018

The Chrome bug has been reported by someone else, and fixed in Chrome 68 :)
https://bugs.chromium.org/p/chromium/issues/detail?id=811528

@ngyikp ngyikp closed this as completed Sep 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants