High-performance browser automation bridge and multi-instance orchestrator with advanced stealth injection and real-time dashboard.
fix: improved skill and fixture
Boschf69e2e876c14
diff --git a/skills/pinchtab/SKILL.md b/skills/pinchtab/SKILL.mdindex d3238306..f16c969a 100644--- a/skills/pinchtab/SKILL.md+++ b/skills/pinchtab/SKILL.md@@ -170,7 +170,7 @@ pinchtab nav <url> --print-tab-id # Print only the new tabId opinchtab back # Navigate back in historypinchtab forward # Navigate forwardpinchtab reload # Reload current page-pinchtab tab # List tabs+pinchtab tab # List tabs (bare form; there is no `tab list` subcommand — `pinchtab tab list` returns 404)pinchtab tab <tab-id> # Focus an existing tabpinchtab tab new <url> # Open a new tabpinchtab tab close <tab-id> # Close a tab — use this to clean up stale tabs between runs@@ -207,6 +207,7 @@ pinchtab snap --text # Text output formatpinchtab text # Page text content (Readability-filtered; drops nav/repeated headlines)pinchtab text --full # Full page text (document.body.innerText) — use when Readability is dropping content you needpinchtab text --raw # Alias of --full+# `text` has no `--format` / `--plain` flag — `--full` / `--raw` are the only mode switches. The CLI returns JSON `{url, title, text, truncated}`; pipe through `| jq -r .text` if you want just the body.pinchtab find <query> # Semantic element searchpinchtab find --ref-only <query> # Return refs only```@@ -244,9 +245,9 @@ pinchtab drag <selector> --drag-x <n> --drag-y <n> # Single-step drag by pixelpinchtab type <selector> <text> # Type with keystrokespinchtab fill <selector> <text> # Set value directlypinchtab press <key> # Press key (Enter, Tab, Escape...)-pinchtab hover <selector> # Hover element+pinchtab hover <selector> # Hover element — dispatches a `mousemove`, which normal event listeners and CSS `:hover` receive. Sites that wire hover via inline `onmouseenter="..."` attributes usually still respond; if they don't, fall back to `pinchtab eval` calling the handler directly (e.g. `pt eval "showInfo(2)"`).pinchtab select <selector> <value|text> # Select dropdown option by value attr, or fall back to visible text-pinchtab scroll <pixels|direction|selector> # Scroll page (e.g. 800), by direction (up/down/left/right), or to an element (ref, #id, .class, //xpath, text:...)+pinchtab scroll <pixels|direction|selector> # Positional only — no `--y`/`--pixels`/`--delta-y` flag. Valid directions: up, down, left, right (800 px step). `top`/`bottom` are NOT direction keywords — scroll to a specific element (e.g. `'#footer'`) or pass an integer like `scroll 99999` to scroll far enough. Examples: `pinchtab scroll 1500`, `pinchtab scroll down`, `pinchtab scroll '#footer'`.```Rules:@@ -488,8 +489,9 @@ pinchtab click "xpath://button[@type='submit']"- Use `pinchtab screenshot` only when visual regressions, CAPTCHA, or layout-specific confirmation matters.- If a ref disappears after a change, treat that as expected and fetch fresh refs instead of retrying the stale one.- Action responses like `{"clicked":true,"submitted":true}` mean the event fired on the target element — **not** that the form was accepted by the server or passed native HTML validation. Always verify the expected success marker or state change via `snap`/`text` before treating a submission as complete.-- **Same-origin iframes** are supported natively via `pinchtab frame <target>` — a stateful scope that subsequent selector-based `/snapshot` and `/action` calls inherit. Typical flow: `pinchtab frame '#payment-frame'` → `pinchtab snap -i -c` (refs reflect iframe interior) → `pinchtab fill '#card'` / `click '#pay'` → `pinchtab frame main`. Target accepts `main`, an iframe ref, a CSS selector for the iframe element, a frame name, or a frame URL. Nested iframes need multiple hops. Refs emitted by a full `snap` (no `-i`) for iframe descendants carry frame context — ref-based actions work across the boundary without an explicit scope set. **Cross-origin iframes** are not exposed as frame scopes; fall back to `eval` against `iframe.contentDocument` (same-origin-policy permitting). `pinchtab text` (and `text --full`) honors the active frame scope and also accepts an explicit `--frame <frameId>` flag for one-shot reads — so after `pinchtab frame '#content-frame'`, a following `pinchtab text --full` extracts from the iframe's document, not the outer page.-- `eval` expressions share the same realm across successive calls, so a top-level `const`/`let` from one call collides with the next (`SyntaxError: Identifier already declared`). Wrap multi-statement expressions in an IIFE so the bindings don't leak: `pinchtab eval "(() => { const r = document.querySelector('#x').getBoundingClientRect(); return {x: r.x, y: r.y, w: r.width, h: r.height}; })()"`. This also fixes the DOMRect case where `getBoundingClientRect()` returns a value whose own-enumerable fields don't survive JSON serialization — the explicit projection makes the result stable.+- **Same-origin iframes** are supported natively via `pinchtab frame <target>` — a stateful scope that subsequent selector-based `/snapshot` and `/action` calls inherit. Typical flow: `pinchtab frame '#payment-frame'` → `pinchtab snap -i -c` (refs reflect iframe interior) → `pinchtab fill '#card'` / `click '#pay'` → `pinchtab frame main`. Target accepts `main`, an iframe ref, a CSS selector for the iframe element, a frame name, or a frame URL. Nested iframes need multiple hops. Refs emitted by a full `snap` (no `-i`) for iframe descendants carry frame context — ref-based actions work across the boundary without an explicit scope set. **Cross-origin iframes** are not exposed as frame scopes; fall back to `eval` against `iframe.contentDocument` (same-origin-policy permitting). `pinchtab text` (and `text --full`) honors the active frame scope and also accepts an explicit `--frame <frameId>` flag for one-shot reads — so after `pinchtab frame '#content-frame'`, a following `pinchtab text --full` extracts from the iframe's document, not the outer page. **The `--frame` argument must be a frame ID (the 32-char hex `frameId` from `pinchtab frame <target>` output), not a CSS selector.** For a one-shot read, the idiom is: `FID=$(pinchtab frame '#content-frame' | jq -r .current.frameId); pinchtab frame main; pinchtab text --full --frame "$FID"`. Passing a selector like `text --frame '#content-frame'` returns "no frame for given id found".+- **`eval` → always IIFE.** `eval` expressions share the same realm across calls, so any top-level `const`/`let`/`class` from one call collides with the next: `SyntaxError: Identifier 'x' has already been declared`. Use an IIFE on every `eval` that introduces identifiers, not only on multi-statement ones: `pinchtab eval "(() => { const r = document.querySelector('#x').getBoundingClientRect(); return {x: r.x, y: r.y, w: r.width, h: r.height}; })()"`. For a single expression that doesn't introduce identifiers (e.g. `document.title`, `document.getElementById('x').value`), the IIFE is optional. The IIFE pattern also fixes DOMRect serialization — `getBoundingClientRect()` returns a value whose own-enumerable fields don't survive JSON, so the explicit projection is what actually ships the numbers back.+- **`pinchtab text` (both default and `--full`) returns content from `display:none` and `visibility:hidden` nodes** because it reads `document.body.innerText` (and Readability's input) from raw DOM — the visibility cascade is not applied. When you need to confirm that a success banner or error message is *actually visible* (not just present as a pre-seeded hidden element), verify via `pinchtab snap` (the accessibility tree respects visibility and hides non-rendered subtrees) or via `eval` against the element's `offsetHeight` / `getComputedStyle().display`. A common trap: a page ships with a hidden success `<div>` pre-rendered; `text` will report the success string before the form is ever submitted.- The compact snapshot shows `<option>` elements by their visible text, not their `value` attribute. You don't normally need to look up the `value`: the `select` action accepts either — it matches on `value` first and falls back to visible text (case-insensitive). Only reach for `eval` + `Array.from(select.options)` when debugging an unexpected no-match error.- `text:<value>` selectors are resolved by a JS-level search over visible text and can intermittently fail with `DOM Error` or `context deadline exceeded` on large/dynamic pages. If you have a fresh `snap -i -c` in hand, prefer the ref (`e12`) — refs resolve by stable backend node IDs and don't depend on page-side JS.- `snap -i -c` (interactive, compact) skips non-interactive descendants. For iframe interiors, either set a `frame` scope first or use a full `pinchtab snap` (no `-i`) which flattens same-origin iframe descendants into the parent snapshot.diff --git a/tests/benchmark/fixtures/accordion.html b/tests/benchmark/fixtures/accordion.htmlindex 71c7f3a2..a2f21e81 100644--- a/tests/benchmark/fixtures/accordion.html+++ b/tests/benchmark/fixtures/accordion.html@@ -15,9 +15,9 @@align-items: center;font-weight: bold;}- .section-header::after { content: '▸'; transition: transform .15s; }+ .section-header::after { content: '▸'; }.section[aria-expanded="true"] .section-header::after { transform: rotate(90deg); }- .section-body { padding: 0 16px; max-height: 0; overflow: hidden; transition: max-height .15s; }+ .section-body { padding: 0 16px; max-height: 0; overflow: hidden; }.section[aria-expanded="true"] .section-body { padding: 12px 16px; max-height: 200px; }</style></head>