#2744·stagehand

API gaps blocking a full Playwright exit: pdf(), network events, emulation presets (measured list)

Author: BervinmCreated Aug 16, 2026Updated Aug 25, 2026

Context

We run a production content site and have migrated our browser automation toward Stagehand 4.0.0, primarily for self-healing selector resolution against a live Chrome over CDP. It works well: healed selectors have kept two brittle UI-driving pipelines alive with zero selector maintenance.

We would like to drop Playwright entirely, and we measured exactly what still blocks that. Across 15 automation scripts (QA sweeps, PDF rendering, screenshot/chart rendering, scraping, UI publishing), 13 are blocked by missing APIs. Ranked by how many scripts each gap blocks:

Blocked scripts Missing API Notes
4 page.pdf() Even a thin passthrough to CDP Page.printToPDF would cover it
3 context emulation options userAgent, deviceScaleFactor, reducedMotion etc. at context/page creation; viewport alone is already covered by setViewportSize
2 device presets (a la playwright.devices) hand-rolling UA + viewport + touch flags per device is error-prone
2 page.on("response" / "requestfailed" / "pageerror") today page.on supports only console; response/network events are the backbone of any QA sweep that needs to catch non-200s and dead assets
2 role/text locator builders (getByRole, getByText) CSS/XPath work, but role selectors are what keep QA and publishing scripts readable
1 page.route() request interception
1 page.waitForFunction() poll-on-a-timer works but is noisy
1 page.setContent() workaround exists via evaluate, listed for completeness
1 page.content() trivial via evaluate(() => document.documentElement.outerHTML)
1 page.waitForURL()
1 fine-grained keyboard (keyboard.down/up, modifiers) page-level type/key_press exist today

Ask

Are any of these on the roadmap? The top three (PDF, network/error events, context emulation + device presets) would unblock 9 of our 13 blocked scripts on their own, and all three look like thin passthroughs to capabilities CDP already exposes. Happy to provide more detail on any of the use cases, or to test previews.