Implementation:Microsoft Playwright Chromium Protocol Types
| Knowledge Sources | |
|---|---|
| Domains | TypeDefinitions, ChromiumProtocol |
| Last Updated | 2026-02-12 00:00 GMT |
Overview
Auto-generated TypeScript type definitions for the Chrome DevTools Protocol (CDP), used internally by Playwright's Chromium browser driver.
Description
This file (~23,824 lines) is generated by /utils/protocol-types-generator/index.js and provides complete TypeScript type definitions for the Chrome DevTools Protocol. All types are organized under the Protocol namespace, with sub-namespaces for each CDP domain.
Key CDP domains defined include:
- Accessibility:
AXNodeId,AXValueType,AXValueSource,AXNode - CSS: Style sheets, computed styles, CSS rules, media queries
- DOM: Node types, attributes, shadow DOM, document traversal
- Debugger: Breakpoints, call frames, script sources, stepping
- Emulation: Device metrics, geolocation, media features, touch emulation
- Input: Mouse, keyboard, touch input dispatch
- Network: Requests, responses, cookies, caching, WebSockets, fetch interception
- Page: Frames, navigation, lifecycle events, screenshots, PDF generation
- Runtime: Remote objects, execution contexts, console API, exception handling
- Target: Browser targets, sessions, target discovery
- Performance: Metrics, tracing, profiling
The file also defines a binary type alias (type binary = string) used throughout for base64-encoded binary data.
Usage
These types are imported by Playwright's Chromium connection layer (src/server/chromium/) to provide type-safe interaction with the Chrome DevTools Protocol. They enable compile-time checking of CDP command parameters and return types when sending protocol messages to Chromium browsers.
Code Reference
Source Location
- Repository: Microsoft_Playwright
- File:
packages/playwright-core/src/server/chromium/protocol.d.ts
Import
import { Protocol } from './protocol';
Generation
# This file is auto-generated; do not edit manually
# Generated by: /utils/protocol-types-generator/index.js