【问题标题】:Trying to launch a specific chrome profile for debugging with VS Code尝试启动特定的 chrome 配置文件以使用 VS Code 进行调试
【发布时间】:2022-10-19 00:31:45
【问题描述】:

我可以使用 cmd 启动我的 chrome 配置文件:chrome.exe --profile-directory="Profile 6"

使用 launch.json 它会启动正确的配置文件:

{
  "version": "0.2.0",
  "configurations": [
    {
      "type": "chrome",
      "request": "launch",
      "name": "Launch Chrome against localhost",
      "url": "http://localhost:4200/account/login?admin_login=true",
      "webRoot": "${workspaceFolder}",
      "userDataDir": false,
      "runtimeArgs": ["--profile-directory=profile 6"],
      "urlFilter": "http://localhost:4200/*"
    }
  ]
}

然而,即使运行 ngServe,只要正确的 chrome 配置文件打开“无法附加到浏览器”,我就会收到此错误

它适用于默认配置,但不适用于正确的配置文件:

{
  "version": "0.2.0",
  "configurations": [
    {
      "type": "chrome",
      "request": "launch",
      "name": "Launch Chrome against localhost",
      "url": "http://localhost:4200",
      "webRoot": "${workspaceFolder}"
    }
  ]
}

配置文件被称为“配置文件 6”这一事实是否与空间有关?

【问题讨论】:

    标签: visual-studio-code


    【解决方案1】:

    您必须先退出所有正在运行的 Chrome 实例,无法将正在运行的 Chrome 用户配置文件置于调试模式。这就是扩展默认创建新用户配置文件的原因。

    【讨论】:

      猜你喜欢
      • 2019-08-25
      • 2019-05-30
      • 2019-06-06
      • 1970-01-01
      • 2021-05-25
      • 2017-08-09
      • 2021-11-21
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多