Clone this wiki locally
The project follows the usual convention for node projects:
libfor implementation files
toolsfor helper scripts
front-endcontains a snapshot of Blink's Developer Tools GUI
front-end-nodecontains Node Inspector files that are added to the GUI
The backend consist of several parts (all files are in
Web server which handles browser requests, sends back front-end files and handles socket.io connections.
Agents implement Developer Tools Protocol, which is used for communication between front-end and back-end. The protocol itself has a concept of agents, Node Inspector's agents are the same.
callback.jsimplement a client for V8 debugger protocol. The official protocol documentation is very incomplete. Alternative protocol documentation: bugger's PROTOCOL.md
A lot of functionality is extracted into standalone classes, which makes it easier to test it in isolation.
convert.jsimplements conversions between types used by DevTools and V8 debugger.
breakevent and prepares stack trace for the front-end with the help of
FrontendCommandHandlerlistens for front-end messages and dispatches them to Agents
Reverse-engineering the front-end
The internal documentation for Blink Developer Tools front-end and protocol is quite often incomplete and you have to intercept the communication between DevTools and the backend in Chrome to understand how it works.
There are two tools to help:
Enable protocol debug logs by starting the Node Inspector via the following command line. Node Inspector will dump all message to stdout/stderr.
$ DEBUG=node-inspector:protocol:* node-inspector
Alternatively, you can enable
front-end/InspectorBackend.js. All messages (requests, responses, events) will be logged to DevTools console.
Run the front-end against the Chrome/Chromium back-end to see what does the "real" implementation do. See "Running" in Chrome Developer Tools documentation.
Upgrading the front-end
Pick the Blink branch you would like to update to from list of all branches.
Review diffs to find out any breaking changes. Be prepared to spend possibly large amount of time to fix them all.
Commit the updated front-end.
Re-apply changes to
front-end/inspector.html, commit the fixed version.
Fix all problems found in step 3.
Test basic scenarios (set breakpoint, step through code, inspect variables, live edit) to make sure they still work, fix any problems found.
Submit a pull request.