Platform Guides
Web (Chrome DevTools Protocol)
CUP for web pages using Chrome DevTools Protocol (CDP).
Overview
The web adapter captures web page accessibility trees via the Chrome DevTools Protocol (CDP). This works with Chrome, Chromium, and Chromium-based browsers (Edge, Brave, etc.).
Requirements
- Chrome or Chromium-based browser
- Browser must be started with
--remote-debugging-portflag
Setup
Start Chrome with remote debugging
# macOS
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --remote-debugging-port=9222
# Windows
chrome.exe --remote-debugging-port=9222
# Linux
google-chrome --remote-debugging-port=9222Install with web extra
pip install computeruseprotocol[web]npm install computeruseprotocol
# Web adapter is included by defaultCapture
# Python
python -m cup --platform web --cdp-port 9222
# TypeScript
npx cup --platform web --cdp-port 9222How it works
The web adapter connects to Chrome's DevTools WebSocket endpoint, enables the Accessibility domain, and retrieves the full ARIA accessibility tree. It then maps ARIA roles directly to CUP roles (they share the same vocabulary).
Role mapping
Web ARIA roles map 1:1 to CUP roles since CUP's role taxonomy is ARIA-derived:
| ARIA Role | CUP Role |
|---|---|
button | button |
checkbox | checkbox |
combobox | combobox |
textbox | textbox |
link | link |
img | img |
list | list |
listitem | listitem |
dialog | dialog |
tab | tab |
| (etc.) | (same) |
Action mapping
| CUP Action | Web (CDP) Implementation |
|---|---|
click | Input.dispatchMouseEvent at element center |
type | DOM.focus + Input.insertText |
setvalue | Runtime.callFunctionOn to set .value |
toggle | DOM.focus + click |
expand / collapse | Click |
select | DOM.focus + click |
scroll | Input.dispatchMouseEvent with mouseWheel type |
Platform-specific properties
For the full platform-specific property schema, see Node Structure.
The web adapter captures CSS selectors and XPaths in platform.web, useful for hybrid automation approaches.
Limitations
- Requires Chrome to be started with
--remote-debugging-port - Only captures the active tab by default
- Shadow DOM elements may have limited accessibility tree representation