How do I set the default browser as chrome in Visual Studio Code?

Visual Studio-CodeVscode Settings

Visual Studio-Code Problem Overview


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.

Visual Studio-Code Solutions


Solution 1 - Visual Studio-Code

Go to file-> preferences -> user settings -> search "By Default it will open your default favorite browser" set your browser.

Solution 2 - Visual Studio-Code

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.

  1. From the Tasks menu, Select 'Configure Tasks'
  2. The entry field prompts you for 'Select a task to configure'
  3. Choose 'Create tasks.json file from template'
  4. Edit the file to include the following block:

{
            "version": "0.1.0",
            "command": "Chrome",
            "windows": {
                "command": "C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe"
            },
            "args": ["${file}"]
}

Solution 3 - Visual Studio-Code

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.

Solution 4 - Visual Studio-Code

This Alternate Way helped me:)

GoTo-->Google Chrome-->Settings-->Default browser-->Set Google Chrome as default browser

Solution 5 - Visual Studio-Code

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.

Solution 6 - Visual Studio-Code

Go to Settings -> Extensions -> Live Server Config -> Update Default Browser:

enter image description here

Solution 7 - Visual Studio-Code

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.

Solution 8 - Visual Studio-Code

search for local.testsettings on vscode on the search and for web tests, change the browser to chrome and apply.

Solution 9 - Visual Studio-Code

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!

Solution 10 - Visual Studio-Code

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.

Solution 11 - Visual Studio-Code

Click settings -> enter: default browser -> find: Open-in-browser:Default -> enter: Google Chrome

Solution 12 - Visual Studio-Code

Google Chrome > Settings (left sidebar) > Default browser = Google Chrome

Google Chrome > Settings (left sidebar) > Default browser = Google Chrome

Solution 13 - Visual Studio-Code

Just change your default web browser in your OS. In Windows 10, you can search "default browser" then the wizard for changing it, will be appear.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionSu LlewellynView Question on Stackoverflow
Solution 1 - Visual Studio-CodepreetyView Answer on Stackoverflow
Solution 2 - Visual Studio-CodeSu LlewellynView Answer on Stackoverflow
Solution 3 - Visual Studio-CodeJaselView Answer on Stackoverflow
Solution 4 - Visual Studio-CodeshyamView Answer on Stackoverflow
Solution 5 - Visual Studio-CodeJustinView Answer on Stackoverflow
Solution 6 - Visual Studio-CodeMeghna LohaniView Answer on Stackoverflow
Solution 7 - Visual Studio-CodeVitor PeixotoView Answer on Stackoverflow
Solution 8 - Visual Studio-Code55s25View Answer on Stackoverflow
Solution 9 - Visual Studio-Codeuser18790606View Answer on Stackoverflow
Solution 10 - Visual Studio-CodeHamdy SaadyView Answer on Stackoverflow
Solution 11 - Visual Studio-CodeMin GuoView Answer on Stackoverflow
Solution 12 - Visual Studio-CodeAshwinView Answer on Stackoverflow
Solution 13 - Visual Studio-CodeFatemeh AlimardaniView Answer on Stackoverflow