相关文章推荐
稳重的凉茶  ·  linux puppeteer ...·  1 月前    · 
求醉的大熊猫  ·  安卓WebView和Word ...·  7 月前    · 
英勇无比的萝卜  ·  Swing+JxBrowser ...·  8 月前    · 
千年单身的冲锋衣  ·  list' object has no ...·  1 年前    · 
深情的夕阳  ·  Tkinter ...·  1 年前    · 
Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

How do I run a .html file in VS Code on Chrome OS? It sais I need to add the absolute path to browser in a Json file.

Trying to open a .html file in VS Code on Chrome OS

Chrome OS, I was able to run it through Firefox and Chromium installed as Linux Apps on Linux Beta. But not in the default Chrome Browser on Chrome OS. James Livingstone Jun 12, 2022 at 7:40

U need to install a separate version of Chrome on VS Code then it will work. I just had the same problem and found the solution somewhere hidden on Reddit, but it worked :-)

sudo apt install chromium

Then you can add this to your .vscode/launch.json

  "configurations": [
      "type": "chrome",
      "request": "launch",
      "name": "Launch Chrome against localhost",
      "runtimeExecutable": "/usr/bin/chromium",
      "url": "http://localhost:3000",
      "webRoot": "${workspaceFolder}",
      "smartStep": true
                Yep - this looks like the solution, except that you do not need to specify the executable path once this is installed.  Note that your default browser in crostini (xdg-open and x-www-browser) will change to the chromium install.   This makes sense since the Google Chrome installation probably cannot be re-launched with a debug port on a Chromebook. The VS Code documentation does not lend much help here (github.com/microsoft/vscode-js-debug/blob/main/OPTIONS.md).  Removing chromium does revert the browser redirect.
– Michael Erickson
                Dec 17, 2022 at 1:52
        

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question. Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.