google-chrome - VS Code + Debugger for Chrome : open tab in existing Chrome instance, 而不是新窗口?

标签 google-chrome visual-studio-code vscode-debugger

我正在使用 Debugger for Chrome VS 代码扩展。我正在使用 yarn start 处理 React 项目,打开于 localhost:3000 .
我有一个已经在运行的 Chrome 实例,我使用我的 Google 帐户登录。但是,当我点击“针对本地主机启动 Chrome”时,该选项卡会在我未登录的新 Chrome 实例中打开。
enter image description here
我该怎么做 强制选项卡在我已经运行的 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/

相关文章:

html - html中的唯一id值

python - VS code 调试时截断变量

angular - 在停止调试时终止 vs 代码中的 ng serve 任务

python - 用于调试 Python 模块的 Visual Studio Code launch.json 设置

google-chrome - 了解 Chrome 中的 Websocket 框架

google-chrome - 如何将 chrome 开发者控制台停靠在左侧?

javascript - Android 浏览器和 iOS Chrome 是否支持全屏 API?

visual-studio-code - "extension.LiveServer.goOnline"未找到,'liveSass.command.watchMySass' 未找到

c - 运行 C 程序后,VS Code 上显示不同类型的扩展错误

python - VS 代码 : how to make a python snippet that after string or expression hitting tab will transform it