Skip to content
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

is it possible to add a firefox launch.json? #45

Open
twiddlingbits opened this issue Sep 29, 2024 · 4 comments
Open

is it possible to add a firefox launch.json? #45

twiddlingbits opened this issue Sep 29, 2024 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@twiddlingbits
Copy link
Owner

twiddlingbits commented Sep 29, 2024

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",
       ]
   },
@twiddlingbits twiddlingbits added the enhancement New feature or request label Sep 29, 2024
Repository owner deleted a comment Sep 29, 2024
@JohnDog3112
Copy link
Collaborator

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.

@twiddlingbits
Copy link
Owner Author

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.

@JohnDog3112
Copy link
Collaborator

"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.

@twiddlingbits
Copy link
Owner Author

People generally just want to test theri code with stable releases, otherwise you don't know whos bug it is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants