In my extension I want to use my own WebAssembly module.
After loading my module (to background.html
, or popup.html
), I catch the compile erro
Chrome implemented special policy 'wasm-eval' exclusively for apps and extensions to resolve this problem. It is chrome-specific, but slowly moving into CSP and WebAssembly standards. Just replace 'unsafe-eval'
with 'wasm-eval'
in @Xan's solution.
Note though, this is still an attack vector and it's your responsibility to verify the source of executed assembly. See for example uBlock's author thoughts on this policy.