question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Opening html in browser (or, using any command)

See original GitHub issue

Hi, thanks the very neat extension.

I tried to configure the Code Runner to open html files in Chrome, but not working.

Config:

"code-runner.executorMap": {
    "javascript": "node"
},
"code-runner.defaultLanguage": "javascript",
"code-runner.clearPreviousOutput": true,
"code-runner.saveFileBeforeRun": false,
"code-runner.executorMapByFileExtension": {
    ".html": "chrome.exe"
}

But I m getting below error:

[Running] chrome.exe "d:\angular-directive-demo.html"
'chrome.exe' is not recognized as an internal or external command,
operable program or batch file.

[Done] exited with code=1 in 0.176 seconds

I tried given the chrome.exe’s complete path as well, but same issue.

Is there any way to invoke any arbitrary command/exe?

Code Runner: 0.4.1 VSCode: 1.7.1 Windows 8.1

Thanks.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
formulahendrycommented, Nov 7, 2016

Hi @manikantag , I use below config and work:

"code-runner.executorMapByFileExtension": {
    ".html": "\"C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe\""
}

output:

[Running] "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" "d:\Try\test\test.html"

[Done] exited with code=0 in 0.252 seconds

Please check whether you have taken care of the back slash and the space of file path.

0reactions
LegioN2004commented, Aug 1, 2022

“code-runner.executorMapByFileExtension”: { “.html”: “"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe"” } i am not using google chrome and i changed the path of the chrome.exe with current firefox browser executable which I found using the find location option in right click menu and now code runner is showing error as following " PS C:\Users\sunny\Downloads\dotfiles\mili-gitlab-repo\Documents\VSCode programs> “C:\Program Files\Mozilla firefox\firefox.exe” “c:\Users\sunny\Downloads\dotfiles\mili-gitlab-repo\Documents\VSCode programs\30daysofHTML\day2.html” ParserError: Line | 1 | … irefox.exe" "c:\Users\sunny\Downloads\dotfiles\mili-gitlab-repo\Docum … | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | Unexpected token ‘“c:\Users\sunny\Downloads\dotfiles\mili-gitlab-repo\Documents\VSCode | programs\30daysofHTML\day2.html”’ in expression or statement. " this is my code runner executor map “code-runner.executorMap”: { “javascript”: “node”, “php”: “C:\php\php.exe”, “python”: “python”, “perl”: “perl”, “ruby”: “C:\Ruby23-x64\bin\ruby.exe”, “go”: “go run”, “html”: “"C:\Program Files\Mozilla firefox\firefox.exe"”, “java”: “cd $dir && javac $fileName && java $fileNameWithoutExt”, “c”: “cd $dir && gcc $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt”, “cpp”: “cd $dir && g++ -std=c++17 $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt” },

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to access an HTML document in a browser
Find the HTML record you need to see, right-click on it, and pick Open with from the menu. You will see a full...
Read more >
Open HTML file with Google Chrome using command-line
In general, the above command-line can be used to launch any GUI app to open associated file. open command is built into macOS....
Read more >
How to Run a HTML File: 12 Steps (with Pictures) - wikiHow
1. Understand HTML. HTML stands for Hypertext Markup Language. HTML files are text files which represent the content and the layout of a...
Read more >
How to Open HTML Files in Your Browser from Visual Studio ...
Visual Studio Code doesn't have a built-in method for launching HTML and other files in Google Chrome, but you can configure it to...
Read more >
How to view an HTML file in the browser with Visual Studio ...
Now Press Ctrl + K followed by V, it will open your html in a near by tab. Tadaaa !!! Now emmet commands...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found