Twirlman
Twirlman

Reputation: 1189

How to setup Brave as default browser to Visual Studio Code's Live Server?

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

Answers (4)

Darren Street
Darren Street

Reputation: 1838

This worked for me. (Windows 11 if it makes a difference)

  1. In MS Code: File > Preferences ? Settings

  2. In the search settings box type: "liveserver"

  3. Click the link the edit the "settings.json" file

  4. Add this to the end of the object "liveServer.settings.AdvanceCustomBrowserCmdLine": "brave"

  5. Close Settings.json and the settings tabs.

  6. 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)

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

Milan Rawal
Milan Rawal

Reputation: 31

  1. Go to, File > Preferences
  2. search liveServer
  3. You'll see 'Live Server > Settings: Chrome Debugging Attachment'
  4. Click 'edit in settings.json'

There you need to change the custombrowser to brave.

Vscode brave browser debug screenshot:

Vscode brave browser debug screenshot

Upvotes: 3

Jon
Jon

Reputation: 424

Edit in Setting.json

  "liveServer.settings.AdvanceCustomBrowserCmdLine":"YourPath\\brave.exe"

This will override "Custom Browser" setting, highest priority.


  1. I find the setting's value:

enter image description here

  1. then I find the setting's key:

enter image description here 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

Phillip Ollison
Phillip Ollison

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

Related Questions