Hi,
I would like to write a Chrome extension that uses the chrome.debugger API to attach to a node.js process started with "--inspect", in order to set breakpoints and control execution of the node process. I consulted the documentation, and it appears I would use the API chrome.debugger.attach in order to attach the debugging client to the node.js process. The attach API accepts as an argument the targetId of the debugging target to attach. My question is, how can I find the targetId of the Node.js process, which I can pass to attach?
I attempted to find the node.js debugging target using the chrome.debugger.getTargets API, but the resulting array of targetInfo did not include the node.js process. The node.js process does appear in chrome://inspect, and I am able to use chrome devtools to inspect the process. I'm wondering if the node.js process does not appear in the targetInfo results because the node.js process is a remote debugging target, whereas all other results in this array were local debugging targets.
I would appreciate any insight into this. Thank you for your help,
Jake