Architectural Deep Dive: Direct CDP — Weavetab Blog — Weavetab Blog

Testing frameworks like Playwright and raw Chrome DevTools Protocol were built for humans writing deterministic test suites. We compare the two as...

Architectural Deep Dive: Direct CDP — Weavetab Blog

Published: 2026-08-28 · Research

Testing frameworks like Playwright and raw Chrome DevTools Protocol were built for humans writing deterministic test suites. We compare the two as...

## The architectural divergence

Autonomous agents have turned the browser into an execution surface for language models. Two transport styles dominate today:

1. **Playwright / Puppeteer**: built for unit testing and CI. They run behind an external Node.js process boundary, tend to surface large raw DOM or accessibility dumps into the model context, and drive the page through locator APIs.
2. **Direct Chrome DevTools Protocol (CDP)**: low-level and fast, but uncurated. Used naively it hands an agent a large, unindexed node tree with no notion of what is actionable.

Weavetab takes a third path: a single in-process client on the CDP connection, wrapped in a layer that returns a compact, spatially-resolved set of actionable elements instead of the raw tree.

---

## What actually differs

| Dimension | Weavetab | Playwright |
|---|---|---|
| Execution model | In-process CDP client | Node process wrapper |
| What the model sees | Compact semantic action map | Accessibility / DOM snapshot |
| Element targeting | Spatial centroids + semantic ids | CSS selectors / refs |
| Browser session | Your real profile | Isolated context by default |
| Context footprint | Small, pruned | Grows with page complexity |

The most important row is the third one from the top. An agent does not need the whole page; it needs to know what it can act on, where it is, and what changed. Everything else is context cost.

---

## Why context size dominates

Turn latency for an agent is bounded by the model, not the browser. The browser-side tool call is usually a small fraction of a turn. The larger, compounding cost is how many tokens a page snapshot puts into the context window at every step. A stack that streams a full tree on each turn spends most of its budget re-describing things that did not change.

\