Feature
agent-browser supports snapshot -s <sel> and get text <sel> to scope to a CSS selector.
Implementation
- Add
selector query param to /snapshot and /text
- For text:
Runtime.evaluate with document.querySelector(sel).innerText
- For snapshot:
DOM.querySelector to find node, then Accessibility.getPartialAXTree with backendNodeId
Acceptance Criteria
/snapshot?tab_id=&selector=.main-content returns only nodes within that element
/text?tab_id=&selector=h1 returns only the heading text
Co-authored-by: blackfloofie 265516171+blackfloofie@users.noreply.github.com
Feature
agent-browser supports
snapshot -s <sel>andget text <sel>to scope to a CSS selector.Implementation
selectorquery param to/snapshotand/textRuntime.evaluatewithdocument.querySelector(sel).innerTextDOM.querySelectorto find node, thenAccessibility.getPartialAXTreewith backendNodeIdAcceptance Criteria
/snapshot?tab_id=&selector=.main-contentreturns only nodes within that element/text?tab_id=&selector=h1returns only the heading textCo-authored-by: blackfloofie 265516171+blackfloofie@users.noreply.github.com