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 there a way to make -start-debugger-server a default configuration option of Firefox? #315

Closed
TomasHubelbauer opened this issue Jan 6, 2023 · 5 comments

Comments

@TomasHubelbauer
Copy link

I was able to get this extension to work in the launch mode, but when a new instance of Firefox launches with my debug target, I don't think it will share stuff like local storage and similar, so I won't be able to reuse any context I create while testing in my normal Firefox instance.

I figured configuring Firefox to enable the attach configuration scenario was the way to go, but it appears as though for it to work, Firefox needs to be launched with -start-debugger-server each time I want to enter a debugging session?

If that's the case, I worry the inconvenience of having to restart Firefox each time and lose tabs etc. is too great and people won't make as much use of attaching to a running Firefox instance as they - I think - ought to.

Is there an about:config option that can instruct Firefox to start with the debugger server running each time or alternatively, start the debugger server when the developer tools are open, if it isn't running already? I believe this would greatly improve the DX around using VS Code with Firefox debugger.

It is unfortunate as I am a Firefox user and I love the browser, but Firefox really lacks in ease of use when compared with Chrome here and it IMO hurts Firefox and its users alike.

@ButuzGOL
Copy link

ButuzGOL commented Mar 20, 2023

@WebMechanic
Copy link

Check this solution https://apple.stackexchange.com/questions/17476/how-can-i-force-command-line-arguments-to-a-program-shortcut-in-the-dock/17479#17479 it works for me Same logic works for ff

what makes you think the OP is using a Mac?

@WebMechanic
Copy link

WebMechanic commented May 31, 2023

@TomasHubelbauer I suggest you install the Firefox Developer Editon to do web development work. It'll run side-by-side to mainstream or nightly editions.
Create a (desktop) shortcut for the Developer Editon that includes -start-debugger-server.

You might want to enable Settings Sync for your FF editions so FF Dev shares the same plugins and configuration -- pick and choose; Just disable "open tabs" 😁

Add the name of the dev edition profile to launch.json (i.e. "profile": "dev-edition-default"). Launch Developer Editon, open about:profiles and find it's "default profile".

I worry the inconvenience of having to restart Firefox each time and lose tabs etc. is too great

then don't restart. Add the "reAttach": true in launch.json so FF Dev won't terminate after the debug session ended and your precious tabs will be safe.
If it doesn't launch the correct version also add "firefoxExecutable": "developer",

The extension README explains all options you can add to control FF.

Since local storage is also part of the profile, launching with a new temp profile will of course give you an empty storage. And for security reasons this stuff is not shared between instances and apps.

@nchevobbe
Copy link
Member

Firefox doesn't start with a debugger server by default (for good reason, we don't want anyone to be able to control your Firefox instance).
The regular DevTools toolbox doesn't use the debugger server either, as we're in the same instance, so you can't "reuse" that, because it doesn't exists.
WebMechanic answers is probably the best solution at the moment, but as we're looking into maintaining this, we know it would be nice to ease the whole launch/attach workflow

@TomasHubelbauer
Copy link
Author

Thanks folks! Appreciate all the thoughtful responses here. Hopefully they help others as well. Unfortunately I am looking for a workflow that's not supported. My ideal setup is one where I don't have to install Developer or use different profiles. I do think the limitations described are reasonable though and the proposed solutions might help others as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants