ritwickdey / vscode-live-server

Launch a development local Server with live reload feature for static & dynamic pages.
https://ritwickdey.github.io/vscode-live-server
MIT License
5.81k stars 1.29k forks source link

Live server will not open in edge on Mac #2843

Open maxbaez9 opened 1 year ago

maxbaez9 commented 1 year ago

I'm submitting a...

[ ] Regression (a behavior that used to work and stopped working in a new release)
[ x] Bug report  <!-- Please search GitHub for a similar issue or PR before submitting -->
[ ] Feature request
[ ] Documentation issue or request
[ ] Other: <!-- Please describe: -->

Current behavior

Live server will not open on microsoft edge when selected as the option under settings.

Screenshot 2023-10-06 at 11 54 15 Screenshot 2023-10-06 at 11 54 30

It works for any other browser, just not edge. If edge is not the default browser for my system nothing will open. But if i select "null" as the option and edge IS the system default browser then live server opens in edge.

Expected behavior

Live server opens in whichever browser is selected as default in the vs code settings, regardless of what is the default system browser

Environment

MacOS

Browser:

- [ ] Chrome (desktop) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] IE version XX
- [x ] Edge version XX

For Tooling issues:

- Live Server: v5.7.9
- Platform:  MAC
- Visual Studio Code: 1.83.0 
stevewlrls commented 9 months ago

I, too, have this problem. The only work-around I have found is to configure a custom command line in settings.js, e.g.: "liveServer.settings.AdvanceCustomBrowserCmdLine": "microsoft edge"

I've looked at the source code and in src/appModel.ts, in function openBrowser, there are tests for chrome on Darwin (MacOS) but not for Edge. As a result, the launch command (params[0]) that is used is incorrect. (In fact, it's probably incorrect on every platform except maybe Linux.) The above custom command line overrides the default parsing from the CustomBrowser setting.