尝试将 chrome 设置为 mac 上 VSCode 的默认浏览器
我找到了这篇文章:在VS代码中运行Chrome Debugger
我在那里遵循答案,并在我的启动中设置以下内容。json:
{
"name": "Launch Chrome",
"request": "launch",
"type": "pwa-chrome",
"url": "https://localhost:44444/health/status",
"webRoot": "${workspaceFolder}/public",
"runtimeExecutable": "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"
}
问题是,当我运行“启动Chrome”选项时,它会正确打开Chrome,但我的项目 /服务器尚未启动。我真正需要做的是,当我按F5调试项目时,我希望系统启动IIS Express,加载服务器项目,然后在清理所有缓存的情况下打开Chrome。
因此,我试图对此进行更改:
"launchBrowser": {
"enabled": true,
"args": "${auto-detect-url}",
"windows": {
"command": "cmd.exe",
"args": "/C start ${auto-detect-url}"
},
"osx": {
"command": "open"
},
"linux": {
"command": "xdg-open"
}
}
对此:
"launchBrowser": {
"enabled": true,
"args": "${auto-detect-url}",
"windows": {
"command": "cmd.exe",
"args": "/C start ${auto-detect-url}"
},
"osx": {
"command": "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"
},
"linux": {
"command": "xdg-open"
}
}
但是我在调试控制台中收到以下错误:
crbug/1173575, non-JS module files deprecated.
chromewebdata/(index)꞉6549:22:6774
crbug/1173575, non-JS module files deprecated.
chromewebdata/(index)꞉6549:22:6774
crbug/1173575, non-JS module files deprecated.
chromewebdata/(index)꞉6549:22:6774
crbug/1173575, non-JS module files deprecated.
我也尝试更新设置。但是我不知道要指定什么值:
"debug.javascript.defaultRuntimeExecutable": {
"pwa-chrome": "",
"pwa-node": "node"
}
I found this article: Problem to run chrome debugger in VS Code
I followed the answer there and set up the following in my launch.json:
{
"name": "Launch Chrome",
"request": "launch",
"type": "pwa-chrome",
"url": "https://localhost:44444/health/status",
"webRoot": "${workspaceFolder}/public",
"runtimeExecutable": "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"
}
The problem is that when I just run that "Launch Chrome" option, it opens Chrome correctly but my project / server hasn't started yet. What I really need to do is when I press F5 to debug my project, I'd like the system to start iis express, load my server project and then open chrome with all the cache cleaned up.
So I tried to change this:
"launchBrowser": {
"enabled": true,
"args": "${auto-detect-url}",
"windows": {
"command": "cmd.exe",
"args": "/C start ${auto-detect-url}"
},
"osx": {
"command": "open"
},
"linux": {
"command": "xdg-open"
}
}
to this:
"launchBrowser": {
"enabled": true,
"args": "${auto-detect-url}",
"windows": {
"command": "cmd.exe",
"args": "/C start ${auto-detect-url}"
},
"osx": {
"command": "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"
},
"linux": {
"command": "xdg-open"
}
}
but I get the following errors in my debug console:
crbug/1173575, non-JS module files deprecated.
chromewebdata/(index)꞉6549:22:6774
crbug/1173575, non-JS module files deprecated.
chromewebdata/(index)꞉6549:22:6774
crbug/1173575, non-JS module files deprecated.
chromewebdata/(index)꞉6549:22:6774
crbug/1173575, non-JS module files deprecated.
I've also tried to update settings.json but I don't know what values to specify:
"debug.javascript.defaultRuntimeExecutable": {
"pwa-chrome": "",
"pwa-node": "node"
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
默认情况下,我可以使用此
launchBrowser
配置在 OSX 上的 Chrome 中打开我的 swagger 页面。OSX Chrome arg 应该只是所需的启动 URL。
警告:看来,使用此配置,当我停止调试时,Chrome 会完全关闭。
I was able to get my swagger page to open in Chrome on OSX by default using this
launchBrowser
config.The OSX Chrome arg should just be the desired launch URL.
Word of warning: It seems that, with this configuration, when I stop debugging, Chrome is completely closed.