Skip to content

Commit

Permalink
[CRX] Enable WebAssembly in Chrome extension
Browse files Browse the repository at this point in the history
After the removal of 'unsafe-eval' CSP in mozilla#18651, WebAssembly fails to
load, resulting in issues such as seen in mozilla#18457.

Manifest Version 3 does not allow 'unsafe-eval', does accept the more
specific 'wasm-unsafe-eval' as of Chrome 103. Note that manifest.json
already sets minimum_chrome_version to 103.

This patch also adds `object-src 'self'` because it was required until
Chrome 110. As of Chrome 111, the default is `object-src 'self'` and
`object-src` is no longer required. We could drop `object-src` in the
future, but for now we need to include it to support Chrome 103 - 110.
  • Loading branch information
Rob--W committed Sep 15, 2024
1 parent bb04dd1 commit 3af2ecd
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions extensions/chromium/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
"js": ["contentscript.js"]
}
],
"content_security_policy": {
"extension_pages": "script-src 'self' 'wasm-unsafe-eval'; object-src 'self'"
},
"storage": {
"managed_schema": "preferences_schema.json"
},
Expand Down

0 comments on commit 3af2ecd

Please sign in to comment.