We help IT Professionals succeed at work.

How do I make FireFox my default browser in Visual Studio Code?

High Priority
71 Views
Last Modified: 2019-06-19
How do I make FireFox my default browser in Visual Studio Code? All of the links I've found are either too complicated/involved or the setting through the settings menu option doesn't exist or I can't find it. I'm including a pic of the version information for the version that I'm using. Thanks.Visual Studio Code version info.
Comment
Watch Question

Chinmay PatelChief Technology Ninja
CERTIFIED EXPERT
Distinguished Expert 2019

Commented:
Hi Michael,

1. First and foremost, You have to create a workspace. File -> Open Folder OR File -> Open Workspace (Both option can work)
https://code.visualstudio.com/docs/getstarted/settings

2. After that, you can configure tasks. Terminal -> Configure Tasks
If your current workspace does not have any configured tasks, it will ask you whether it should create a tasks.json file.

3. Paste entire code as it is in the tasks.json file.
{
    // See https://go.microsoft.com/fwlink/?LinkId=733558
    // for the documentation about the tasks.json format
    "version": "2.0.0",
    "tasks": [
        {
            "label": "Opera", // This is a Label of the command, in your case it might be FireFox
            "windows": {
                "command": "D:\\Softwares\\Portable\\Opera\\launcher.exe" // Path to FireFox Executable
            },
            "args": [
                "${file}"
            ],
            "problemMatcher": []
        }
    ]
}

Open in new window


4. Open any html file, Click on Terminal -> Run Task -> Choose Opera

VS Code also has some extensions which you can use to do this.

I would suggest going via Tasks as it is simpler and does not rely on using third party extensions.

Regards,
Chinmay.
Michael SterlingWeb Applications Developer

Author

Commented:
In step 2, after I choose: "create a tasks.json file" it asks me to choose a template. My options are:
  • MS Build

  • maven
  • .NET Core
  • other


which do I choose?
Michael SterlingWeb Applications Developer

Author

Commented:
For what ever its worth, I chose MS Build and it still didn't work. When I ran npm start, IE still fired up.
Chinmay PatelChief Technology Ninja
CERTIFIED EXPERT
Distinguished Expert 2019

Commented:
Post your task.json here please.
Michael SterlingWeb Applications Developer

Author

Commented:
What I commented out is what was placed there automatically.

// {
//     // See https://go.microsoft.com/fwlink/?LinkId=733558
//     // for the documentation about the tasks.json format
//     "version": "2.0.0",
//     "tasks": [
//         {
//             "label": "build",
//             "type": "shell",
//             "command": "msbuild",
//             "args": [
//                 // Ask msbuild to generate full paths for file names.
//                 "/property:GenerateFullPaths=true",
//                 "/t:build"
//             ],
//             "group": "build",
//             "presentation": {
//                 // Reveal the output only if unrecognized errors occur.
//                 "reveal": "silent"
//             },
//             // Use the standard MS compiler pattern to detect errors, warnings and infos
//             "problemMatcher": "$msCompile"
//         }
//     ]
// }
{
    // See https://go.microsoft.com/fwlink/?LinkId=733558
    // for the documentation about the tasks.json format
    "version": "2.0.0",
    "tasks": [
        {
            "label": "Opera", // This is a Label of the command, in your case it might be FireFox
            "windows": {
                "command": "D:\\Softwares\\Portable\\Opera\\launcher.exe" // Path to FireFox Executable
            },
            "args": [
                "${file}"
            ],
            "problemMatcher": []
        }
    ]
}

Open in new window