Looking under the hood of

Chrome DevTools

Konrad Dzwinel

Hello!

Brain.ly
Google Developer Expert
Chrome DevTools
EDL

Remote Debugging Protocol

  • DOM.highlightNode
  • Network.setUserAgentOverride
  • Debugger.setBreakpoint
  • Runtime.evaluate
  • HeapProfiler.takeHeapSnapshot
  • +280 more
protocol.json file in Chromium repository
debugger protocol viewer
browser window devtools window debugging protocol
remote debugging mobile devices
remote debugging websites over the Internet
browser window devtools window
?
debugging protocol

Editors & IDEs

  • Brackets
  • Light Table
  • Sublime Text
  • WebStorm
  • Vi

Monitoring & Testing

chrome-remote-interface


var Chrome = require('chrome-remote-interface');

Chrome(function (chrome) {
    with (chrome) {
        Network.enable();
        Page.enable();
        // log all requests before they are sent
        Network.requestWillBeSent(function (params) {
            console.log(params.request.url);
        });
        // once page loads, navigate to another page
        once('ready', function () {
            Page.navigate({'url': 'https://github.com'});
        });
    }
 });
                    

Chrome extensions - debugger API


// attach debugger to a specific tab
chrome.debugger.attach({
    tabId: tabId
}, '1.1', function() {
    // navigate to another page
    chrome.debugger.sendCommand({
        tabId: tabId
    }, 'Page.navigate', {
        url: 'https://github.com'
    });
});
                    
DevTools voice commands
browser window devtools window
?
debugging protocol

Alternative DevTools "back-ends"

Betwixt - network analyzer

Debugging protocol adapters

RemoteDebug

Wrap-up

Thanks!

@kdzwinel