is it possible to add a firefox launch.json?
The following vscode launch.json works, except that SharedArayBuffers are not enabled. It appears that firefox does not support command line arg to enable shared array buffers. Apparently, a web server must be used.
Is there a way to add firefox to launch.json?
As of now, i removed the launch.json entry because it does not work with twrWasmModuleAsync.
{
// must install "Debugger for Firefox" extension
"name": "Examples/Tests (firefox)",
"type": "firefox",
"request": "launch",
"reAttach": true,
"file": "${workspaceFolder}/examples/index.html",
"firefoxArgs": [
"--enable-features=SharedArrayBuffer",
]
},
It seems like it's possible. There are certain configurations that allow a SharedArrayBuffer to be used from a fileuri. However, they require you to use the dev/nightly version of firefox. As for loading it from the command line, there is a -profile arg that allows a profile to be loaded from a specific folder. It only needs it's own folder and the prefs.js file from a preconfigured Firefox profile with the flags mentioned below. Though, we would need to add the files it automatically generates to the .gitignore to avoid cluttering the repo.
The only flags/options that need to be set are:
- security.fileuri.strict_origin_policy = false
- By disabled this option, CORS protections are disabled for local files
- dom.postMessage.sharedArrayBuffer.bypassCOOP_COEP.insecure.enabled = true
- This enables SharedArrayBuffer's for every website. However, it can only be enabled on the developer/nightly version of firefox.
is there a difference between "nightly" and "developer". "Nightly" would not be good to use for testing. "developer" might be okay.
We could also just add instructions to the debug doc page for those that want to test with firefox this way.
"Nightly" is the alpha branch of Firefox while "developer" is a slightly modified version of the "beta" branch that seems to have better compatibility with having the "release" version of Firefox on the same system.
People generally just want to test theri code with stable releases, otherwise you don't know whos bug it is.