Wasm module compile error in Chrome Extension

后端 未结 2 1713
无人及你
无人及你 2021-02-19 14:10

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

2条回答
  •  滥情空心
    2021-02-19 14:47

    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.

提交回复
热议问题