developit / greenlet

🦎 Move an async function into its own thread.
https://npm.im/greenlet
4.67k stars 100 forks source link

Refused to create a worker from blob #24

Closed JCKodel closed 6 years ago

JCKodel commented 6 years ago

Refused to create a worker from 'blob:http://localhost:8080/87c22970-8fee-44d9-982e-00aafe130b22' because it violates the following Content Security Policy directive: "default-src * 'self' 'unsafe-inline' 'unsafe-eval' data: gap: content:". Note that 'worker-src' was not explicitly set, so 'default-src' is used as a fallback.

Current content security policy: default-src * 'self' 'unsafe-inline' 'unsafe-eval' data: gap: content:

I don't have the slightest idea of how content security policy works, so, it would be nice some light in the README.md =)

sylvaindumont commented 6 years ago

@JCKodel you have to add worker-src blob: to your csp header and script-src blob: as a fallback. But If you want to keep it simple just add blob: at the end of your default-src

developit commented 6 years ago

@sylvaindumont want to PR that into the README?

sylvaindumont commented 6 years ago

sure #28

developit commented 6 years ago

Update: I've switched Greenlet over to use Data URIs. Should we update #28?

developit commented 6 years ago

Thanks, merged the PR!

cochiseruhulessin commented 4 years ago

Whats the point of using CSP if this is the solution?