The
Internal Architecture of
Chrome Developer Tools
Miroslav Bajtoš
About Me
Miroslav Bajtoš

@bajtos

github.com/bajtos

Writing code since ~1992
Serious about Test Driven Development and Clean Code
Co-organizing Code Retreat events
Blogging at http://devblog.cz

Maintaining Node Inspector and Reggie
Developing LoopBack mobile backend and client SDKs
Chrome Developer Tools
Introduction to Developer Tools

DEMO!
The Internal Architecture
Inside the browser...
Blink
(WebKit)

V8
(JS VM)
C++
glue
Inspector
localhost:9222
Inspect the Inspector

DEMO!
Agents

Agents

Inspector
Page
Network
Runtime
Debugger
Console

Dom
CSS
Profiler
HeapProfiler
Timeline
Worker
+ more (23 in total)

https://developers.google.com/chrome-developer-tools/docs/protocol/tot/index
Debugger Protocol

DEMO!
RemoteDebug

http://remotedebug.org/
Node Inspector
Introduction to Node Inspector

DEMO!
Architecture of Developer Tools (again)
Inside the browser...
Blink
(WebKit)

V8
(JS VM)
C++
glue
Inspector
localhost:9222
Node Inspector’s Architecture
Debugged application
Node.js
core

C++
glue

V8

Node Inspector
web
server

JS
glue

backend
bridge
Protocols

DEMO!
Evaluate Expression - Frontend
frontend {
"method": "Runtime.evaluate",
"params": {
"expression": "throw new Error("foo")",
"objectGroup": "console",
"includeCommandLineAPI": true,
"doNotPauseOnExceptionsAndMuteConsole":
false,
"returnByValue": false,
"generatePreview": true
},
"id": 33
}
Evaluate Expression - V8 Request
V8 request {
"seq": 23,
"type": "request",
"command": "evaluate",
"arguments": {
"expression": "throw new Error("foo")",
"global": true
}
}
Evaluate Expression - V8 Response
V8 response {
"seq": 23,
"request_seq": 23,
"type": "response",
"command": "evaluate",
"success": false,
"message": "Error: foo",
"running": true
}
Evaluate Expression - Backend
backend {
"id": 33,
"result": {
"result": {
"type": "object",
"objectId": "ERROR",
"className": "Error",
"description": "Error: foo"
},
"wasThrown": true
}
}
Evaluate Expression - Blink Backend
{
"id": 33,
"result": {
"result": {
"type": "object",
"objectId":
"{"injectedScriptId":1,"id":1}",
"className": "Error",
"description": "Error: foo"
},
"wasThrown": true
}
}
BONUS: DevTools Extensions
Links
Slides
Demos:
github.com/bajtos/talk-devtools-internals

The Internal Architecture of Chrome Developer Tools