【问题标题】:VS Code + Debugger for Chrome: open tab in existing Chrome instance, instead of new window?VS Code + Debugger for Chrome:在现有 Chrome 实例中打开选项卡,而不是新窗口?
【发布时间】:2020-11-26 22:06:49
【问题描述】:

我正在使用Debugger for Chrome VS 代码扩展。我正在使用 yarn start 开发一个 React 项目,该项目在 localhost:3000 打开。

我已经使用我的 Google 帐户登录了一个正在运行的 Chrome 实例。但是,当我点击“针对 localhost 启动 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}"
        },
    ]
}

【问题讨论】:

  • 您找到解决方案了吗?我陷入了同样的境地。请发布您找到的任何解决方案/解决方法。这会很有帮助。
  • 我将其发布为对我自己的 q 的回答,但它一直被否决,因此我将其删除。继续看看它是否适合你(添加"userDataDir": false):briandesousa1.wordpress.com/2018/05/12/…

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


【解决方案1】:

以下指南很有帮助,基本上你想使用"request": "attach" 而不是"request": "launch"

https://www.freecodecamp.org/news/how-to-set-up-the-debugger-for-chrome-extension-in-visual-studio-code-c0b3e5937c01/

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-06-21
    • 2017-05-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-11-29
    • 2011-10-29
    相关资源
    最近更新 更多