Safari Extension load wasm file in popup wrong MIME type error

After loading Safari Web Extension, when making request from the popup to load wasm file it return with wrong MIME type, which makes the WebAssembly compileStreaming to reject the response from fetch.

Summary URL: safari-web-extension://ECF91D91-37F4-499D-8D7E-6AA029A2DBED/canvaskit/canvaskit.wasm Status: 200 Source: — Initiator: flutter_bootstrap.js:10:505

Request Accept: / Referer: safari-web-extension://ECF91D91-37F4-499D-8D7E-6AA029A2DBED/index.html User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.0 Safari/605.1.15

Response Access-Control-Allow-Origin: * Content-Length: 6751354 Content-Security-Policy: script-src 'self' 'wasm-unsafe-eval'; object-src 'self'; Content-Type: application/octet-stream

In the response the inner server that returns files for safari-web-extension should return application/wasm

I have the same issue.

Hi, I am having the same issue, the type is application/octet-stream. Did you happen to find a fix?

Also, I am having an issue with WebAssembly instantiate, the safari showing an CSP CompileError: Refused to create a WebAssembly object because 'unsafe-eval' or 'wasm-unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src 'self' 'unsafe-eval' 'wasm-unsafe-eval'".

Could you kindly share your Content-Security-Policy that will load the wasm file?

Thanks!

Safari Extension load wasm file in popup wrong MIME type error
 
 
Q