microsoft / vscode-js-debug

A DAP-compatible JavaScript debugger. Used in VS Code, VS, + more
MIT License
1.67k stars 283 forks source link

[setting] Force into using only one specific Chromium browser for launch debug sessions (change browser path globally) #2069

Open zardoy opened 2 months ago

zardoy commented 2 months ago

Hello, dear maintainers!

Is your feature request related to a problem? Please describe

In our time it is okay to have a lot of Chromium-based browsers installed on your system (like Edge, Opera GX, Arc, etc...). In my case, I feel depressed whenever a new debugging session is launched with Chrome. Things are made even worse when you click links from the debug terminal a lot (which is extremely useful) or use Live Preview external debug features which are also extremely useful and you can't change the browser used in these cases. And I'm always forced to use Chrome! But I want to make sure Chrome never launches on my system! It's because every time I start a new debug session from vscode (using launch request) it makes profile syncing go into a paused state, which is hard to notice with the Chrome UI (and one time I had to travel back home just because a password didn't get synced). Also, only Edge has decent DevTools with ok UI.

Describe the feature you'd like

Provide a setting with a name like Custom Chromium Browser where I can select a popular browser or specify a custom path to the executable like /Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge. Just like livePreview.customExternalBrowser setting.

I bet that option would be loved and used by a lot of users since many people have Chrome installed as the default browser but don't like using it for development.

Workaround

I've made an extension to simplify changing debug config globally (AFAIK it's not possible to do it with builtin methods). So you can just add this into your settings.json:

"jsDebugExtras.extendCustomConfig": {
  "runtimeExecutable": "/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge",
}

And now Chrome will never be opened from vscode again.

Also I like using it for specifying custom launch args like custom frontend with a path to my custom devtools since built-in devtools are not customizable and hence hard to use (with things like auto switching to Sources tab after each page reload which is extremely annoying).


I hope I made it clear and comprehensive enough, would be glad to hear your feedback!

connor4312 commented 2 months ago

good idea, this has been on my mental list for a little while but hadn't had any community asks for it. Will get it done.