-
Notifications
You must be signed in to change notification settings - Fork 125
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
Add ability to force main thread fallback for workers #337
Comments
I like the idea. Shouldn't be too hard to implement. |
Done, you can configure it like so:
|
@lojjic thanks for the rapid response. I'm just trying this out and am having a few issues. Firstly, the change doesn't actually prevent the CSP violation (and therefore triggers the call to the In that failure case it now also breaks the fallback since it returns However, what would be more ideal is if
The Did you want me to make a separate issue for this? |
Ahh, good points. I obviously didn't test this out with a CSP in place. I'll reopen and fix. |
Followup fix is published. I've tested it with all 4 scenarios: CONFIG.useWorkers true+false, and browser worker support true+false. I ended up just moving the supportsWorkers check from module definition-time to module function call-time, and ditched the early return. Unfortunately your idea of passing a |
Thanks, looks to be working for me now. |
Due to the issue described in #31 and the check that is used for falling back to the main thread it is currently not possible to avoid console errors for CSP policy violations and triggering CSP policy violations.
This becomes a greater issue for those using restrictive CSP in combination with reporting by setting the
report-to
orreport-uri
CSP directives (see here for more details). In this configuration each time the page is visited the CSP violation will be reported to that URL.For users who know that they will not be able to provide a permissive enough CSP, it would be desirable to have a mechanism to force the fallback to be used without the check so that the fallback is always used. That would ideally also suppress any warning logs since the user has explicitly chosen to use the fallback.
The text was updated successfully, but these errors were encountered: