Skip to content

Phase 4 Step 10: DevTools Protocol (CDP subset) #51

@thomasnemer

Description

@thomasnemer

Parent: #41

Goal

Implement a subset of the Chrome DevTools Protocol (CDP) to enable debugging with Chrome DevTools frontend, Playwright, and Puppeteer.

Prerequisites

  • None (framing can start early; domains are added as subsystems mature)

Implementation

  • WebSocket server activated via --remote-debugging-port=PORT CLI flag
  • CDP message framing: JSON-RPC over WebSocket, method dispatch
  • Page domain: navigate, reload, getFrameTree, lifecycle events
  • Runtime domain: evaluate, callFunctionOn, getProperties, console API
  • DOM domain: getDocument, querySelector, getOuterHTML, setAttributeValue
  • CSS domain: getComputedStyleForNode, getMatchedStylesForNode
  • Network domain: requestWillBeSent, responseReceived, loadingFinished
  • Console domain: messageAdded
  • New dependency: tokio-tungstenite

Tests

  • WebSocket connection and message framing tests
  • Method dispatch and error handling tests
  • Per-domain command/response tests
  • Integration test: connect Chrome DevTools frontend
  • Integration test: basic Playwright/Puppeteer script

Acceptance Criteria

  • WebSocket server starts on specified port
  • CDP domains (Page, Runtime, DOM, CSS, Network, Console) respond correctly
  • Chrome DevTools frontend can connect and inspect pages
  • Basic Playwright/Puppeteer automation scripts work

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions