【问题标题】:I have difficulties using the Live server extension in vscode in my windows PC我在我的 Windows PC 中使用 vscode 中的 Live 服务器扩展时遇到了困难
【发布时间】:2020-10-23 21:19:43
【问题描述】:

我是 JavaScript 的新手。我刚刚在 VScode 中下载了 Live 服务器扩展。当我通过单击 VScode 状态栏中的“GO LIVE”上线时,我的服务器在特定端口启动,但它没有打开我的默认浏览器,它是 chrome,因此我可以看到我的代码的结果。 我真的被困住了,我需要帮助。感谢您抽出宝贵时间帮助我解决此问题。

【问题讨论】:

  • 您确定将 Chrome 设置为默认浏览器吗?
  • 是的,我在我的谷歌浏览器设置中将我的默认浏览器设置为 chrome。 VScode有地方可以设置成chrome吗?

标签: javascript visual-studio google-chrome visual-studio-code


【解决方案1】:

将此行添加到您的settings.json

"liveServer.settings.CustomBrowser": "chrome"

(在 Windows 上 %AppData%\Code\User\settings.json、在 Linux 上 $HOME/.config/Code/User/settings.json 和在 macOS 上 $HOME/Library/Application Support/Code/User/settings.json

注意:确保在 json 中上一行的末尾添加逗号。示例:

{
    "window.zoomLevel": 0, //note the comma at the end here
    "liveServer.settings.CustomBrowser": "chrome"
}

【讨论】:

  • 这真的很有帮助。我设置了“liveServer.settings.CustomBrowser”:“chrome”
猜你喜欢
  • 1970-01-01
  • 2012-10-31
  • 1970-01-01
  • 2020-03-02
  • 2021-08-19
  • 2012-07-15
  • 1970-01-01
  • 1970-01-01
  • 2021-11-05
相关资源
最近更新 更多