Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

proposal: programmatically expose the V8 inspector URL #11496

Closed
ide opened this issue Feb 22, 2017 · 9 comments
Closed

proposal: programmatically expose the V8 inspector URL #11496

ide opened this issue Feb 22, 2017 · 9 comments
Labels
feature request Issues that request new features to be added to Node.js. inspector Issues and PRs related to the V8 inspector protocol

Comments

@ide
Copy link
Contributor

ide commented Feb 22, 2017

  • Version: 7.6.0 and later
  • Platform: all
  • Subsystem: diagnostics

This is a feature request to add a method to the v8 module that exposes the V8 inspector URL if the process has been started with --inspect. The motivation for this feature is to conveniently add links or buttons to a website that the developer can click to open the V8 inspector.

This is a hypothetical API:

$ node --inspect=dev.example.com:1337
> require('v8').getInspectorUri()
chrome-devtools://devtools/bundled/inspector.html?experiments=true&v8only=true&ws=dev.example.com:1337/8fe96e86-fa03-4a24-b21d-2ce3725e479e

$ node
> require('v8').getInspectorUri()
null
@mscdex mscdex added feature request Issues that request new features to be added to Node.js. inspector Issues and PRs related to the V8 inspector protocol labels Feb 22, 2017
@bnoordhuis
Copy link
Member

Should be easy enough to do but let's see what @nodejs/v8-inspector thinks.

@Fishrock123
Copy link
Contributor

Sounds like a good idea to me. I think it should probably not be on the V8 module though?

@eugeneo
Copy link
Contributor

eugeneo commented Feb 22, 2017

We have plans of introducing bindings for inspector API (it is currently blocked on inspector becoming the default debug API, e.g. by installing the debug signal handler). I believe we could expose this url as a part of that API. API details are still TBD (e.g. I did not even open a pull request)...

@joshgav
Copy link
Contributor

joshgav commented Feb 22, 2017

FWIW you can get the URI and other metadata like the UUID from the JSON returned from http://localhost:9229/json/list (or http://localhost:9229/json) too. See #11207 for an example of that output.

@ofrobots @cristiancavalli @eugeneo are working on providing a JS API to Inspector in general, perhaps access to the list JSON object could be part of that API and cover this request too.

/cc @nodejs/diagnostics

@jasnell
Copy link
Member

jasnell commented Feb 22, 2017

This seems like a good idea. Perhaps even one step further ... an API that simply returns the same data as the /json/list endpoint.

As for where it should live, perhaps when running with --inspect, this can be exposed via process.inspectInfo() API. When running without --inspect, it would simply return undefined

@eugeneo
Copy link
Contributor

eugeneo commented Feb 22, 2017 via email

@joshgav joshgav added the diag-agenda Issues and PRs to discuss during the meetings of the diagnostics working group. label Feb 23, 2017
@joshgav joshgav removed the diag-agenda Issues and PRs to discuss during the meetings of the diagnostics working group. label Feb 23, 2017
@rumkin
Copy link
Contributor

rumkin commented Mar 5, 2017

I think this URI should be also predictable and partially configurable from command line. As I mentioned in #11701 I'm working with remote debug and automated tools doesn't allow to extract this URI from node output.

@Trott
Copy link
Member

Trott commented Jul 30, 2017

Is this in progress? Stalled? Blocked? Help wanted? I guess /cc @eugeneo but really anyone that knows?

@TimothyGu
Copy link
Member

The requested feature is now provided in inspector.url(), so closing.

TimothyGu referenced this issue Jul 30, 2017
PR-URL: #13228
Reviewed-By: Michael Dawson <[email protected]>
Reviewed-By: Refael Ackermann <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Issues that request new features to be added to Node.js. inspector Issues and PRs related to the V8 inspector protocol
Projects
None yet
Development

No branches or pull requests

10 participants