Client Architecture
The client implements the Chrome DevTools Protocol (CDP) on the client side, allowing web pages to be debugged remotely.
CDP Client Structure
Domain Implementation
The client implements multiple CDP domains:
Message Flow
Connection Methods
The client supports two connection methods:
- WebSocket: Remote debugging via server (general use case)
- PostMessage: Communication via postMessage API (for local DevTools scenarios)
Features
- CDP Protocol Implementation: Full client-side CDP implementation
- Domain Support: Multiple CDP domains (Runtime, Page, DOM, Network, etc.)
- Event Handling: Automatic event emission and storage
- Dual Connection: WebSocket and PostMessage support
- Session Replay: Optional rrweb integration for session recording
Initialization
The client is initialized using the init() function:
For vanilla JavaScript (IIFE), use the global API: