- Remove the per-call `save` option from `tab.screenshot()` to simplify usage. - Update `tab.screenshot()` to return the saved file path as a promise string. - Configure screenshot persistence to use daemon path or custom `browser.screenshotDir`. - Add comprehensive tests verifying temp path return and custom directory saving.
2.2 KiB
Drives real Chromium tab; full puppeteer access via JS.
- Static content? `read` the URL. Browser only for JS execution, auth, interactive actions. - `open` → `run` — tabs survive calls and subagents, open once reuse. - `run` scope: `page`, `browser`, `tab`, `display`, `assert`, `wait` available. `wait(fn)` polls until truthy — use instead of polling inside `tab.evaluate`.-
tabhelpers (drop to raw puppeteerpagefor anything uncovered): Element handles:tab.ref("e5")/tab.id(n)return a handle you call methods on directly —(await tab.id(n)).click(). Handles are NOT selectors:tab.click/type/fill/waitFor*take STRING selectors only. Snapshot refs work in any selector slot:tab.click("e5")≡tab.click("aria-ref=e5"). Simple:tab.goto,tab.click,tab.type,tab.fill,tab.press,tab.scroll,tab.scrollIntoView,tab.drag,tab.uploadFile,tab.select,tab.screenshot,tab.extract,tab.evaluate. Screenshots:tab.screenshot({ selector?, fullPage?, silent? })saves tobrowser.screenshotDir, or OS temp when unset, then returns the path. It NEVER accepts a path. Waits:tab.waitFor,tab.waitForSelector,tab.waitForUrl,tab.waitForResponse,tab.waitForNavigation. Snapshots:tab.observe()→ accessibility tree;tab.ariaSnapshot()→ ARIA YAML with[ref=eN].Gotchas:
tab.fillNEVER works for<select>— usetab.select.tab.waitForNavigationmust start BEFORE the trigger click.- Navigation and re-renders (virtualized lists, SPA updates) invalidate ids/refs — re-observe or re-snapshot, then act in the same cell.
- Stalled actions fail fast with named error, never whole-cell timeout.
- Raw request interception is run-scoped: run end removes
requesthandlers, disables interception, releases held requests.
-
app.path→ NEVER tamper with a real desktop app (no stealth patches). -
Selectors: CSS + puppeteer
aria/…,text/…,xpath/…,pierce/…. Playwright-only pseudos (:has-text(),:visible) are REJECTED.