How to enable WebAssembly for Camunda Modeler Plugin


I develop currently a Camunda Modeler Plugin and I want to use a WebAssembly in it. To use it, I need to set script-src: ‘unsafe-eval’ in Content-Security-Policy (GitHub - dteare/wasm-csp).

I tried to do it so:
document.querySelector(‘meta[http-equiv=“Content-Security-Policy”]’).setAttribute(“content”, “script-src ‘self’ ‘unsafe-eval’; object-src ‘self’”);

The meta-tag is updated successfully, but I still get an error: “Build.loader.js:70 wasm streaming compile failed: CompileError: WebAssembly.instantiateStreaming(): Wasm code generation disallowed by embedder”.

The question is: how can I enable WebAssembly for Camunda Modeler Plugin?

Thanks in advance!

Best regards,

Anna Kazakova

I don’t know about a plugin that already achieved this. Can you maybe tell more about your use case?

Yes, sure. I want to integrate the Unity WebGL Build in my plugin. After the click on the activity a predefined AR-view should be shown in the canvas.

I have reused the code from ColorPicker Plugin to handle ‘selection.changed’ event and to show the canvas for the AR-view.

My problem is, that the WebGL Build doesn’t work, because of the error “Wasm code generation disallowed by embedder” (see screen).