Reputation: 2918
I am setting up my VS Code environment for the first time, but I can't figure out how to set Chrome as the default browser for the workspace.
Upvotes: 98
Views: 295965
Reputation: 180641
There is finally a setting to configure the default browser to use:
Workbench: External Browser
Configure the browser to use for opening http or https links externally. This can either be the name of the browser (
edge
,chrome
,firefox
) or an absolute path to the browser's excutable. Will use the system default if not set.
See https://github.com/microsoft/vscode/pull/219885 - largely implemented by a contributor (not a vscode team member) - so great.
It is currently working in VScode Insiders v1.92 and so may be out inStable early August 2024.
Upvotes: 3
Reputation: 50035
Use the workbench.externalBrowser
setting
For general link opening, VS Code doesn't have such a feature at the time of this writing. But there is an open feature-request issue ticket: Set default browser for VSCode application #96132. I suggest that you give that issue ticket a thumbs up to show support for it. You can also subscribe to it to get notified about discussion and progress. Please avoid making noisy comments there like ones that just consist of "+1" / "bump".
As stated in other answer posts,
liveServer.settings.CustomBrowser
setting or liveServer.settings.AdvanceCustomBrowserCmdLine
.If you want to see related source code for link opening, see https://github.com/microsoft/vscode/blob/860f38ba5312a3f7cbecc10e6de92f9b3ffa2de3/src/vs/editor/contrib/links/browser/links.ts#L398, https://github.com/microsoft/vscode/blob/860f38ba5312a3f7cbecc10e6de92f9b3ffa2de3/src/vs/editor/contrib/links/browser/links.ts#L221, https://github.com/microsoft/vscode/blob/860f38ba5312a3f7cbecc10e6de92f9b3ffa2de3/src/vs/editor/browser/services/openerService.ts#L25, etc.
Upvotes: 1
Reputation: 1
Begin by accessing the settings menu on your device.
Within the settings, locate the option labeled "Custom Browser" or a similar term.
Click on this option to access the browser settings.
Look for the setting that allows you to change the default browser and select it.
From the list of available browsers, choose the one you prefer.
Once selected, exit the settings menu.
Following these steps should successfully set your default browser to the specific one you've chosen. If you encounter any difficulties or require further assistance, please feel free to ask. Your satisfaction is important to us!
Upvotes: -2
Reputation: 1148
This Alternate Way helped me:)
GoTo-->Google Chrome-->Settings-->Default browser-->Set Google Chrome as default browser
Upvotes: 7
Reputation: 1
None of the above works in my case(my version is August 2022 1.71) to make it work I went straight to **
** from there was a option which says Default set browser so I choose Brave as there is no ads in it while playing the video as chrome plays ads so for getting a proper feeling of using my self made Jarvis I used Brave.
Thanks
Upvotes: -1
Reputation: 1
In my case changing the default browser in the system settings of my pc did it.
Upvotes: -1
Reputation: 11
When you want to use your own browser using "Open with Live Server"
without change OS globally configuration.
In Windows, Visual Studio Code (ver. 1.70.1 (July 2022))
. Go to "File"
> "Preferences"
> "Settings"
Then select a tab, "User" tab if you want your desired browser for all your projects, or select "Workspace" tab or "ProjectName" tab for especified projects.
Then go to "Extensions"
> "Live Server Config"
> "Settings: Custom Browser"
finally change the 'null'
value selecting the browser of your preference from the list (apparently this list depends on installed browsers but i'm not sure).
Upvotes: 1
Reputation: 11
This may be old but I found something that could help.
First go to Settings/Apps/Default Apps. Set your browser as default.
Next go to VSCODE and go to File/Preferences/Settings/Extensions/LiveServerConfig
Then scroll to settings: CustomBrowser Change it to your custom browser
Note- If the browsers don't show up on VSCODE then you need to set it to default in the settings.
Upvotes: 0
Reputation: 3
The Live Server extension was not appearing for me on settings. However, I installed Open in Browser and typed "liveServer.settings.CustomBrowser" in settings and the extension appeared with a dropdown box in which I was able to change the default browser.
Hope this helps!
Upvotes: 0
Reputation: 11
search for local.testsettings on vscode on the search and for web tests, change the browser to chrome and apply.
Upvotes: 0
Reputation: 27
Just a helper for the windows users, I just installed windows 10 again and I was wondering how do I set my vscode to open the server (web) using chrome instead of edge, so to do that you just have to configure your windows to use google chrome as default, you don't need to change anything in vscode, I hope this helps someone.
ps: normally you can go open browser you want to be default and setup the configuration. so in chrome you have to go to configurations and scroll down to default browser.
Upvotes: 1
Reputation: 105
Go to Settings -> Extensions -> Live Server Config -> Update Default Browser:
Upvotes: 7
Reputation: 19
You can adjust settings in your computer to open.HTML file extensions in chrome as a default browser: for Example in PC windows:
go to Control Panel > Default programs > Associate a file type or protocol with a specific programs >HTML extension and choose Chrome.
Upvotes: -1
Reputation: 455
Click settings -> enter: default browser -> find: Open-in-browser:Default -> enter: Google Chrome
Upvotes: -3
Reputation: 564
Chrome can be launched by way of debugging your application. Within launch.json, the configurations[].serverReadyAction.action
configuration was given a possible value of debugWithChrome
in the VS Code February 2019 release. Note that this will also require you have the Debugger for Chrome extension installed. You will not receive a warning if the extension is not installed and you've configured launch.json to use debugWithChrome
.
Note: Configuring launch.json with debugWithChrome
will work even if you launch using CTRL+F5 to run the app without debugging.
Upvotes: 9
Reputation: 367
Go to file-> preferences -> user settings -> search "By Default it will open your default favorite browser" set your browser.
Upvotes: 29
Reputation: 745
The method of modifying tasks.json no longer works in newer versions of Visual Studio Code. The easiest way to be able to launch your code in a browser is to install the Open in Browser extension from the marketplace.
After it is installed and VS Code is reloaded, you can go to your code and press ALT + B to launch your application in your default browser or ALT + SHIFT + B to select the browser you want to use.
You can also right click and select these option from a drop down menu, but I mention this last because this currently does not work in some versions of VS Code.
Upvotes: 3
Reputation: 2918
The other StackOverflow questions regarding the browser, had to do with opening a specific file. Here are the steps to creating a tasks.json file in a brand new environment.
{
"version": "0.1.0",
"command": "Chrome",
"windows": {
"command": "C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe"
},
"args": ["${file}"]
}
Upvotes: 12