【问题标题】:Why doesn't a url with chrome-devtools:// open the devtools?为什么带有 chrome-devtools:// 的 url 不能打开 devtools?
【发布时间】:2020-12-11 03:34:47
【问题描述】:

我有一个使用 --inspect 运行的 nodejs 服务器

当我查看(docker 端口)http://10.0.3.6:4080/json/list 的元信息时,我得到以下信息:

// 20200821141205
// http://10.0.3.6:4080/json/list

[
  {
    "description": "node.js instance",
    "devtoolsFrontendUrl": "chrome-devtools://devtools/bundled/js_app.html?experiments=true&v8only=true&ws=10.0.3.6:4080/15d3e459-3f00-442f-b442-a35cea47d811",
    "devtoolsFrontendUrlCompat": "chrome-devtools://devtools/bundled/inspector.html?experiments=true&v8only=true&ws=10.0.3.6:4080/15d3e459-3f00-442f-b442-a35cea47d811",
    "faviconUrl": "https://nodejs.org/static/images/favicons/favicon.ico",
    "id": "15d3e459-3f00-442f-b442-a35cea47d811",
    "title": "src/server.ts",
    "type": "node",
    "url": "file:///app/src/server.ts",
    "webSocketDebuggerUrl": "ws://10.0.3.6:4080/15d3e459-3f00-442f-b442-a35cea47d811"
  }
]

我希望打开 devToolsFrontendUrl 会打开 chrome devtools 页面。相反,它会尝试执行 google 查询:

Your search - chrome-devtools://devtools/bundled/js_app.html?experiments=true&v8only=true&ws=10.0 ... - did not match any documents.

如何让 Chrome 在 Devtools Node Inspector 中加载 devtoolsFrontendUrl?

【问题讨论】:

  • 在新的 Chrome 中改为devtools://
  • @wOxxOm - 这似乎解决了协议问题 - 它仍然在说 ERR_INVALID_URL

标签: node.js google-chrome google-chrome-devtools node-inspector


【解决方案1】:

看起来 chrome 和 node 项目都将它们的协议名称从 chrome-devtools 更新为 devtools

从节点 10 更新到节点 14 给了我以下结果...

// 20200821150718
// http://10.0.3.6:4080/json

[
  {
    "description": "node.js instance",
    "devtoolsFrontendUrl": "devtools://devtools/bundled/js_app.html?experiments=true&v8only=true&ws=10.0.3.6:4080/50b21fd5-04d4-407a-8e1e-cb1937e0419b",
    "devtoolsFrontendUrlCompat": "devtools://devtools/bundled/inspector.html?experiments=true&v8only=true&ws=10.0.3.6:4080/50b21fd5-04d4-407a-8e1e-cb1937e0419b",
    "faviconUrl": "https://nodejs.org/static/images/favicons/favicon.ico",
    "id": "50b21fd5-04d4-407a-8e1e-cb1937e0419b",
    "title": "src/server.ts",
    "type": "node",
    "url": "file:///app/src/server.ts",
    "webSocketDebuggerUrl": "ws://10.0.3.6:4080/50b21fd5-04d4-407a-8e1e-cb1937e0419b"
  }
]

【讨论】:

    猜你喜欢
    • 2017-02-24
    • 2015-07-29
    • 2019-12-07
    • 1970-01-01
    • 2018-03-02
    • 2015-02-23
    • 2014-03-05
    • 2017-05-04
    • 2019-05-07
    相关资源
    最近更新 更多