Is it possible to open the Chrome NodeJS debugger after running node --inspect-brk
and going to chrome://inspect
in a Tab instead of a standalone Window?
2 Answers
~$ curl http://localhost:9229/json/list
[ {
"description": "node.js instance",
"devtoolsFrontendUrl": "chrome-devtools://devtools/bundled/inspector.html?experiments=true&v8only=true&ws=127.0.0.1:9229/043a8dfa-cd2b-4d41-82db-740a9d332499",
"faviconUrl": "https://nodejs.org/static/favicon.ico",
"id": "043a8dfa-cd2b-4d41-82db-740a9d332499",
"title": "/Users/josh/.nvm/versions/node/v8.9.1/bin/node",
"type": "node",
"url": "file://",
"webSocketDebuggerUrl": "ws://127.0.0.1:9229/043a8dfa-cd2b-4d41-82db-740a9d332499"
} ]
Open the chrome-devtools://devtools/bundled/inspector.html?experiments=true&v8only=true&ws=127.0.0.1:9229/043a8dfa-cd2b-4d41-82db-740a9d332499
URL in a Chrome tab.
The Inspector Help page links to a Chrome extension that purports to open this link automatically, but it didn't work for me.
-
What node version are you using?
devtoolsFrontendUrl
is not present when I do the curl, but the extension is working! Im using v8.9.1 Commented Nov 24, 2017 at 19:46 -
-
On macOS you can execute the following (Provided you have
jq
installed):open -a 'Microsoft Edge.app' "$( curl -sSf htt p://localhost:9229/json/list | jq -r '.[0].devtoolsFrontendUrl' )"
You could changeMicrosoft Edge.app
forChrome.app
or another Chromium browser app Commented Oct 24, 2023 at 16:20
This extension worked for me
It supports opening in a tab and reconnecting automatically. It's add supported.