Reputation: 1
I am using CEF v116 (C++) for a desktop application and trying to load a WebAssembly bundle. This bundle has a js wrapper layer which allocates memory using SharedArrayBuffer and exposes wasm APIs to be called by the React based application running over CEF. Currently, I am getting an error ReferenceError: SharedArrayBuffer is not defined
when loading the JS wrapper of wasm.
I have looked into the requirement of making a website run in cross-origin isolated manner to support use of SharedArrayBuffer which is used to load wasm. My react application is serving files from file://
protocol. Since there is no server, I cannot modify any response header to meet the cross-origin isolation requirement. In this case, how to achieve cross-origin isolation in CEF?
I have tried to modify the loading of files in react application from file://
protocol to https://
protocol. But this is still giving ReferenceError
for SharedArrayBuffer
.
Can I modify CefResponse
and add headers for COOP and COEP in this setup? Where should it be done in CEF?
Is there any other way to be able to load WASM in CEF running React based application?
Upvotes: 0
Views: 68