I'm trying to load up a wasm module in my Chrome plugin. Chrome complains about the following function in the wasm module generated by emscripten. It trips on the following js
Uncaught EvalError: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src 'self' blob: filesystem:".
function createNamedFunction(name, body) {
name = makeLegalFunctionName(name);
/*jshint evil:true*/
return new Function(
"body",
"return function " + name + "() {\n" +
" \"use strict\";" +
" return body.apply(this, arguments);\n" +
"};\n"
)(body);
}
I'm loading the script in the background.html file so it can behave as a module . .
<script type="module" src="../js/background.js"></script>
<script type="module" src="../js/AudioWorkletProcessor.js"></script>
<script type="module" src="../js/kernel.wasmmodule.js"></script>
How are people getting around this with web assembly in their plugins?