-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix emrun for COOP/COEP/CORP #10014
Comments
cc @annevk |
Hmm, when running a page with emrun, there is only one origin in play (and no iframes even), so any cross-origin restrictions should not apply there? Or I suppose is this due to the use of Object URLs to load the worker.js? |
It's not yet enabled on Nightly: https://bugzilla.mozilla.org/show_bug.cgi?id=1594748. The flags mentioned in comment 0 there can be used to experiment. |
I'm using Firefox 72.0b4 (Firefox Developer) on Windows, and without setting anything in about:config I get the mentioned error.
In Firefox 71.0 (Latest Release) on Windows I get the error: Do the example projects work for you in Firefox Developer or Release+ |
Yeah, that's expected, as |
So if I'm understanding you right, Firefox Developer edition, without any flags set, doesn't not work with webassembly and webworkers? |
I have the same problem,that means Firefox will no longer support webassembly pthreads? |
MeanWhile I set dom.postMessage.sharedArrayBuffer.withCOOP_COEP and javascript.options.shared_memory,but it didn't work |
We shouldn't set dom.postMessage.sharedArrayBuffer.withCOOP_COEP, because it enables the browser feature that blocks postMessage if we don't set the headers.
I'd say yes. I could get it to work with this flag: |
|
I got it,and I agree that Asking users to disable safety features is dangerous. |
I agree, I just meant that the flag "dom.postMessage.sharedArrayBuffer.withCOOP_COEP" won't magically make things work. But I don't get why unsetting it makes postMessage throw. |
Setting the flags :
makes it work for me. |
Both the config and heaers are ok to be added to emrun, if someone wants to put up a PR. (emrun is a dev/testing tool, not an end user tool, so any user guards don't apply) |
True. I am a noob, but I think this is not for production right?: I can send a PR. |
Yeah, emrun is not a prodution server, but a local testing/development/test harness server. |
Firefox has recently added restrictions on WebAssembly.Memory objects shared between webworkers. (see here). Chrome is also planning on adding that in the near future.
Unfortunately this means that pthreads builds no longer work with Firefox, and will soon start failing in Chrome.
Some examples of projects that no longer work in Firefox:
https://rustwasm.github.io/wasm-bindgen/exbuild/raytrace-parallel/
https://www.qt.io/web-assembly-example-mandelbrot
https://brianotto.github.io/ui-builder/web/
These now throw:
TypeError: The WebAssembly.Memory object cannot be serialized. The Cross-Origin-Opener-Policy and Cross-Origin-Embedder-Policy HTTP headers will enable this in the future.
Currently I'm working around this by setting the preference:
dom.postMessage.sharedArrayBuffer.bypassCOOP_COEP.insecure.enabled
(the Emscripten tests do the same), but obviously this is not a proper solution.I tried adding the following headers to emrun:
however this appeared to have no effect.
Anyone know what we're actually supposed to do? Ideally we should fix emrun, and update the wiki so people know the server requirements for serving wasm.
More information is available here.
The text was updated successfully, but these errors were encountered: