According to the Chrome DevTools protocol viewer page:
In this scenario, you can substitute Developer Tools front-end with your own implementation. Instead of navigating to the HTML page at http://localhost:9222, your application can discover available pages by requesting: http://localhost:9222/json and getting a JSON object with information about inspectable pages along with the WebSocket addresses that you could use in order to start instrumenting them.
However, according to the the Target Domain documentation, sending a message (via websockets) with {"method": "Target.getTargets"}
returns a "list of available targets":
Target.getTargets # Retrieves a list of available targets.
RETURN OBJECT:
targetInfos
array
[ TargetInfo ]
: The list of targets.
What is the difference?
Per aslushnikov's answer on the GH issue:
Followed by:
Essentially, both seem to be fine; however, my take away is that using the
Target.getTargets
method is newly preferred