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

Optionally support synchronous syntax highlighting #223

Open
lucaswerkmeister opened this issue Sep 3, 2017 · 0 comments
Open

Optionally support synchronous syntax highlighting #223

lucaswerkmeister opened this issue Sep 3, 2017 · 0 comments

Comments

@lucaswerkmeister
Copy link
Contributor

Since version 2, rainbow requires a Content-Security-Policy that allows blob: in workers, to support this:

const blob = new Blob([fullString], { type: 'text/javascript' });
return new Worker((window.URL || window.webkitURL).createObjectURL(blob));

With a more restrictive CSP, this results in a CSP error logged to the console, and preloading blocks that keep spinning forever. In this case, it would be nice to have an option to make Rainbow run the syntax highlighting synchronously instead of in a worker.

Feel free to suggest other solutions to the problem “Rainbow doesn’t work due to CSP”, of course… for example – is it really necessary to construct the worker script as a blob? Can’t it get the entire rainbow.js file?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant