How to Enable and Use the Protocol Monitor in Google Chrome DevTools to Inspect CDP Traffic

Modern browser automation tools like Puppeteer, Playwright, and Selenium WebDriver communicate with Google Chrome using the Chrome DevTools Protocol (CDP). Under the hood, every click in the Elements panel, every network throttling rule, and every recorded trace generates JSON-RPC commands transmitted over a WebSocket. For frontend engineers, test automation developers, and security researchers, Google Chrome DevTools includes a hidden utility: the Protocol Monitor.

What is the Protocol Monitor and Why Does it Matter?

The Protocol Monitor exposes the internal nervous system of Google Chrome DevTools. Rather than viewing the processed GUI output, developers can observe the exact protocol events passing between the browser backend and the DevTools frontend:

  • Real-Time CDP Stream: Displays incoming notifications and outgoing method requests (e.g., DOM.getDocument, Network.enable, Page.navigate).
  • Execution Latency Profiling: Measures round-trip response times for individual protocol commands to identify automation bottlenecks.
  • Interactive Command Testing: Allows developers to compose and send arbitrary CDP JSON-RPC commands directly to the running browser session without writing external Node.js or Python automation scripts.

How to Enable the Protocol Monitor in Google Chrome

The Protocol Monitor is an advanced diagnostic drawer that must be toggled on inside DevTools:

  1. Launch Google Chrome and open any webpage.
  2. Open DevTools by pressing Ctrl + Shift + I (Windows/Linux) or Cmd + Option + I (Mac).
  3. Click the Settings (Gear) icon in the upper right corner of DevTools (or press F1).
  4. In the left sidebar, navigate to the Experiments tab.
  5. In the search filter box, type protocol.
  6. Check the box for Protocol Monitor.
  7. Close the Settings panel (or click the blue Reload DevTools banner that appears).

How to Open and Inspect Protocol Traffic

Once activated, open the Protocol Monitor drawer:

  1. Within DevTools, press Esc to toggle open the bottom drawer pane.
  2. Click the More tools (three vertical dots) button on the left edge of the drawer toolbar.
  3. Select Protocol monitor from the menu.
  4. The Protocol Monitor table opens, immediately logging active browser events.
  5. Interact with the webpage (click a button, reload the page, or inspect a DOM element) to see live commands populate the feed.
  6. Click on any row in the table to open the sidebar inspection pane, revealing the complete JSON-RPC Request parameters and the corresponding browser Response payload.

Sending Custom CDP Commands Directly from DevTools

You can issue commands directly to Chrome to test automation behaviors interactively:

  1. In the Protocol Monitor drawer, click the Send command prompt located at the bottom.
  2. Type a protocol method name (with full auto-complete support), such as:
    Page.captureScreenshot
  3. Supply JSON parameters if required, for example:
    {"format": "png", "quality": 100}
  4. Press Enter. Chrome immediately executes the underlying C++ browser routine and returns a base64-encoded image response directly in the Protocol Monitor console.

Key Protocol Domains and Common Methods

CDP Domain Primary Method Examples Practical Development Usage
Page Page.navigate, Page.reload, Page.printToPDF Programmatic navigation control, PDF generation, and DOM lifecycle hooks.
Network Network.setExtraHTTPHeaders, Network.emulateNetworkConditions Automated header injection, bandwidth throttling, and cookie inspection.
Emulation Emulation.setDeviceMetricsOverride, Emulation.setGeolocationOverride Simulating mobile display viewports, device pixel ratios, and GPS coordinates.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.