How to Use the Protocol Monitor in Microsoft Edge DevTools to View Chrome DevTools Protocol (CDP) Traffic

Modern browser automation tools—such as Puppeteer, Playwright, Selenium 4, and enterprise web scrapers—interact with browser engines via the standardized Chrome DevTools Protocol (CDP). Under the hood, every action taken in Microsoft Edge (from setting breakpoints and throttling networks to emulating mobile viewports) translates into JSON-RPC WebSocket commands sent to the Chromium rendering engine.

When developing custom automation scripts or debugging why a browser automation framework fails to click an element or capture a screenshot, inspecting raw CDP command streams is invaluable. Microsoft Edge DevTools includes a built-in diagnostic panel specifically for this purpose: the Protocol Monitor. This guide explains how to enable and utilize the Protocol Monitor to capture, filter, and analyze live CDP traffic.

Enabling the Protocol Monitor Panel

The Protocol Monitor is an experimental diagnostic drawer tool in Chromium browsers:

  1. Open Microsoft Edge and navigate to any web application.
  2. Press F12 (or Ctrl + Shift + I on Windows; Cmd + Option + I on macOS) to open DevTools.
  3. Press Esc to open the secondary drawer panel.
  4. Click the More tools icon (the three vertical dots or plus symbol in the drawer tab bar).
  5. Select Protocol monitor from the dropdown list.

Core Interface Layout of the Protocol Monitor

Once opened, the Protocol Monitor begins streaming every JSON-RPC interaction between DevTools and the browser engine:

  • Method Column: Displays the CDP domain and command name (e.g. Network.enable, Page.navigate, DOM.getDocument).
  • Direction Arrows: Outbound green arrows denote commands sent from DevTools/client to the browser; inbound blue arrows denote responses and asynchronous events pushed from the browser.
  • Request & Response Drawers: Clicking any command row opens a structured JSON viewer exposing full payload parameters and execution timestamps.
  • Target: Indicates the specific browser tab, background worker, or iframe context executing the command.

Step-by-Step CDP Inspection and Emulation

1. Capturing Live Page Navigation Commands

With the Protocol Monitor open, refresh the active web page. You will observe the foundational CDP bootstrap sequence:

send: Page.navigate {"url": "https://example.com"}
recv: {"id": 12, "result": {"frameId": "9E87A...", "loaderId": "A1B2..."}}
recv: Page.frameNavigated {"frame": {...}}
recv: Page.loadEventFired {"timestamp": 1729238400.12}

2. Filtering Specific Protocol Domains

Because CDP streams thousands of events during complex DOM renders, use the search filter bar at the top of the panel:

  • Type Network. to isolate network request interceptors and header modifications.
  • Type Emulation. to inspect device metrics overrides and geolocation mocking.
  • Type Runtime. to examine remote JavaScript evaluation calls.

3. Sending Custom CDP Commands Manually

The Protocol Monitor allows developers to construct and transmit custom JSON-RPC commands directly into the engine:

  1. Click the Send command button (paper airplane icon) at the bottom of the Protocol Monitor panel.
  2. Type the target CDP method: Browser.getVersion.
  3. Press Ctrl + Enter to dispatch. The engine returns the browser version, user agent string, and JavaScript engine revision immediately in the response pane.

Frequently Monitored CDP Domains

CDP Domain Primary Function Automation Use Case
Page Page lifecycle, navigation, and screenshots Automating PDF generation and load event hooks
Network HTTP/HTTPS requests, headers, and cookies Simulating offline modes and injecting auth tokens
DOM Document node querying and mutation events Locating dynamic shadow DOM nodes and elements
Emulation Screen dimensions, touch, and user agents Testing responsive mobile layouts and GPS spoofing

Performance and Diagnostic Best Practices

  • Recording Overhead: Capturing high-frequency protocol events (such as Network.dataReceived) increases DevTools memory usage. Clear the log regularly using the Clear icon during prolonged testing sessions.
  • Exporting Traces: Click the Download icon to save CDP transaction traces as structured JSON files for regression comparison across automation runs.

Get the best tech tips delivered straight to your inbox.

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