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

Add note on a Content Security Policy that is WASM-compatible #248

Closed
ezekg opened this issue Feb 3, 2022 · 1 comment · Fixed by stork-search/site#43
Closed

Add note on a Content Security Policy that is WASM-compatible #248

ezekg opened this issue Feb 3, 2022 · 1 comment · Fixed by stork-search/site#43
Assignees

Comments

@ezekg
Copy link

ezekg commented Feb 3, 2022

I was hitting some hard to debug WASM load issues in Chrome because I was using a restrictive CSP:

<meta
  http-equiv="content-security-policy"
  content="default-src 'self'; script-src 'self'; object-src 'none';"
/>

This resulted in the following rather confusing WASM load error:

Uncaught (in promise) StorkError: Error while loading WASM at /stork.wasm
    at new t (storkError.ts:3:5)
    at wasmManager.ts:33:13

Apparently, in Chrome, you have to add wasm-unsafe-eval or wasm-eval to load WASM:

<meta
  http-equiv="content-security-policy"
  content="default-src 'self'; script-src 'self' 'wasm-unsafe-eval' 'wasm-eval'; object-src 'none';"
/>

One bummer is that, as far as I can tell, this is currently unsupported in Safari. Safari requires you to add unsafe-eval, which is a no-go and essentially eliminates all safeties of a good CSP.

Can we add this info to the docs for the next person?

@ezekg ezekg changed the title Add a note on a Content Security Policy that is WASM-compatible Add note on a Content Security Policy that is WASM-compatible Feb 3, 2022
@jameslittle230
Copy link
Owner

Interesting! I'll actually move this issue to the docs site repository and get to adding something soon.

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

Successfully merging a pull request may close this issue.

2 participants