fix: Playwright 1.58+ / Chrome CDP compatibility (DOMSnapshot API changes)#16
Open
Kyzcreig wants to merge 2 commits intontegrals:masterfrom
Open
fix: Playwright 1.58+ / Chrome CDP compatibility (DOMSnapshot API changes)#16Kyzcreig wants to merge 2 commits intontegrals:masterfrom
Kyzcreig wants to merge 2 commits intontegrals:masterfrom
Conversation
added 2 commits
March 13, 2026 15:19
Three breaking changes in newer Chrome DOMSnapshot API: 1. strings array moved to top level - Old: result.documents[0].strings - New: result.strings (top-level, shared across docs) - Fix: snapshot.strings ?? doc.strings ?? [] 2. childNodeIndexes removed, replaced by parentIndex - Old: nodes.childNodeIndexes[nodeIndex] gave children directly - New: nodes.parentIndex[i] gives parent of node i - Fix: build childrenMap by inverting parentIndex on load 3. paintOrder renamed to paintOrders (plural) - Fix: layout.paintOrder ?? layout.paintOrders 4. inputValue entries can contain -1 (no value) sentinel - Fix: skip valueIdx < 0 5. querySelectorAll in content-extractor returns non-iterable object via Turndown DOM shim - Fix: wrap all querySelectorAll calls with Array.from() 6. CLI --max-steps option parsed as maxSteps but code read stepLimit → NaN → agent quit at step 0 - Fix: options.maxSteps ?? options.stepLimit ?? '25' Tested against https://news.ycombinator.com - agent now successfully extracts page content in step 1.
- Add ollama provider (local, free, OLLAMA_BASE_URL configurable) - Add openrouter provider (OPENROUTER_API_KEY, access free models) - Install ollama-ai-provider@1.2.0 - Patch instructions.md: agent now calls done immediately on read/extract tasks once it has the answer, no more wandering - qwen2.5:7b pull initiated for local use
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
openbrowser fails silently on Playwright 1.58+ / modern Chrome due to breaking changes in Chrome's
DOMSnapshot.captureSnapshotCDP API. The agent either quits at step 0 or crashes with DOM extraction errors on every step.Root Causes & Fixes
1.
stringsarray moved to top levelChrome moved the shared string lookup table from
result.documents[0].stringstoresult.strings(top-level). All tag names, attribute values, and text content were resolving toundefined.2.
childNodeIndexesremoved — useparentIndexinsteadChrome removed
childNodeIndexesentirely. The DOM tree was built with zero children for every node → empty interactive element map →Element with index X not foundon every action.Fix: invert
parentIndexon load to build achildrenMap.3.
paintOrderrenamed topaintOrders4.
inputValueentries contain-1sentinel (no value) — previously crashed5.
querySelectorAllnon-iterable in Turndown DOM shimcontent-extractor.tsiterates querySelectorAll results. Turndown's shim returns non-iterable →{} is not iterableon everyextractcall. Fixed withArray.from().6. CLI
--max-stepsnever appliedCommander maps
--max-steps→options.maxStepsbut code readoptions.stepLimit→NaN→ agent quit at step 0.Bonus
ollamaprovider (local, free, no API key)openrouterprovider (free tier models available)Tested
Playwright 1.58.2 / Chrome 133 — agent successfully navigates, builds element map, extracts content.