CUPComputer Use Protocol
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-port flag

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=9222

Install with web extra

pip install computeruseprotocol[web]
npm install computeruseprotocol
# Web adapter is included by default

Capture

# Python
python -m cup --platform web --cdp-port 9222

# TypeScript
npx cup --platform web --cdp-port 9222

How 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 RoleCUP Role
buttonbutton
checkboxcheckbox
comboboxcombobox
textboxtextbox
linklink
imgimg
listlist
listitemlistitem
dialogdialog
tabtab
(etc.)(same)

Action mapping

CUP ActionWeb (CDP) Implementation
clickInput.dispatchMouseEvent at element center
typeDOM.focus + Input.insertText
setvalueRuntime.callFunctionOn to set .value
toggleDOM.focus + click
expand / collapseClick
selectDOM.focus + click
scrollInput.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

On this page