'How do I test my html code on browser directly from VS Code using tasks.json version 2.0.0 on MacOS?

In Windows, using VS Code tasks.json version 0.1.0, I used to use following code to test my html code in the browser directly from the VS Code shortcut:

    {
      "version": "0.1.0",
      "command": "opera",
      "windows": {
            "command": "///Program Files (x86)/Opera/launcher.exe"
        },
      "args": [
           "DialingCode.html"
       ]
     }

I have recently switched to MacOS. There are no windows. Everything opens up with Finder (will that have an impact on "windows": ?). I am using VS Code for MacOS with tasks.json version 2.0.0. The layout is a little different.

The path to browser is Macintosh HD/Applications/Safari.app

How can I get this to work in MacOS?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source