Reputation: 1189
How to setup Brave as default browser to Visual Studio Code's Live Server if it doesn't appear as an option like Firefox and Chrome in the tooltip when you click the pencil icon in the settings.json?
Upvotes: 6
Views: 12564
Reputation: 1838
This worked for me. (Windows 11 if it makes a difference)
In MS Code: File > Preferences ? Settings
In the search settings box type: "liveserver"
Click the link the edit the "settings.json" file
Add this to the end of the object "liveServer.settings.AdvanceCustomBrowserCmdLine": "brave"
Close Settings.json and the settings tabs.
In the left tab open "Run & Debug" (its just below search). At the top of the panel click the "open "launch.json" button (it looks a bit like a cog wheel)
Add this in the "configurations array"
{
"type": "chrome",
"request": "launch",
"name": "Brave",
"runtimeExecutable": "C:/Program Files/BraveSoftware/Brave-Browser/Application/brave.exe",
"url": "http://localhost:4202",
"webRoot": "${workspaceFolder}"
}
You are done, Create a breakpoint and hit F5
PS: Remember to change the port in the example about, I'm using localhost:4202, but you may be using the default of 4200
Upvotes: 1
Reputation: 31
There you need to change the custombrowser to brave.
Vscode brave browser debug screenshot:
Upvotes: 3
Reputation: 424
Edit in Setting.json
"liveServer.settings.AdvanceCustomBrowserCmdLine":"YourPath\\brave.exe"
This will override "Custom Browser" setting, highest priority.
vscode-live-server Q&A: https://github.com/ritwickdey/vscode-live-server/blob/master/docs/faqs.md#how-to-configure-the-settings-in-my-project
Upvotes: 6
Reputation: 21
Go to Preferences and then click Settings.
In search settings type "Browser".
Scroll down until you see "Live Server > Settings: Custom Browser "
Click the dropdown menu and click "Null"
All Set!!
Upvotes: 2