Hey there,
I'm using WebAssembly.instantiateStreaming() in a content script and it's failing on websites with restrictive CSP policies (eg. Github). It gives me the following error:
I've added this section to my MV3 without success:
content_security_policy: {
extension_pages: "script-src 'self' 'wasm-unsafe-eval'; object-src 'none';",
}
I also tried to use chrome.declarativeNetRequest.updateDynamicRules to relax CSP policies for the main frame, without success either.
I don't know if it's relevant, but I'm injecting the content script using await chrome.scripting.executeScript and I then dynamically import the actual script using a dynamic import (to benefit from ES modules):
// main.ts
;(async () => {
await import(/* @vite-ignore */ './content')
})()
// content.ts
import init from 'my-wasm-module'
await init()
I'm not exactly sure how to fix this issue. Do you know what I'm missing? Thanks!