From 3170bf3f690fd28e6d45e84dc3eb927e237fc758 Mon Sep 17 00:00:00 2001 From: Rob Wu Date: Sun, 15 Sep 2024 12:58:38 +0200 Subject: [PATCH] [CRX] Enable WebAssembly in Chrome extension After the removal of 'unsafe-eval' CSP in #18651, WebAssembly fails to load, resulting in issues such as seen in #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. --- extensions/chromium/manifest.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/extensions/chromium/manifest.json b/extensions/chromium/manifest.json index 27be0ea96ac9f..60c99d9ac4da8 100644 --- a/extensions/chromium/manifest.json +++ b/extensions/chromium/manifest.json @@ -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" },