我正在使用 Debugger for Chrome VS 代码扩展。我正在使用 yarn start
处理 React 项目,打开于 localhost:3000
.
我有一个已经在运行的 Chrome 实例,我使用我的 Google 帐户登录。但是,当我点击“针对本地主机启动 Chrome”时,该选项卡会在我未登录的新 Chrome 实例中打开。
我该怎么做 强制选项卡在我已经运行的 Chrome 实例中打开 反而?launch.json
:
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "launch",
"name": "Launch Chrome against localhost",
"url": "http://localhost:3000",
"webRoot": "${workspaceFolder}"
},
]
}
最佳答案
以下指南很有帮助,基本上你想使用 "request": "attach"
不是 "request": "launch"
.
https://www.freecodecamp.org/news/how-to-set-up-the-debugger-for-chrome-extension-in-visual-studio-code-c0b3e5937c01/
关于google-chrome - VS Code + Debugger for Chrome : open tab in existing Chrome instance, 而不是新窗口?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63287059/