Adom Desktop - Puppeteer Bridge
Public Made by Adomby adom
The Adom Desktop Puppeteer (pup) bridge — drive a real headful browser on the user's desktop from the cloud: open/screenshot/eval/record. Cold-start drives the browser ALREADY on the machine (installed Chrome, else Microsoft Edge — every Windows PC ships with Edge) with a fresh isolated profile, so the common case needs NO download; Chrome for Testing is fetched only as a last resort. Two artifacts: the Releases zip is the bridge runtime (also bundled in Adom Desktop); the pkg installs the container-side Claude skills.
Shipped: browser_scroll / browser_set_viewport / browser_screenshot_element + shadow-DOM eval helpers (v1.8.22) — for the AD-core page-driving thread
Shipped all 5 in pup 1.8.21 / 1.8.22 (runtime). AD relays args verbatim, so zero AD-side change — just new verbs + args. Tested live against wiki.adom.inc/adom/adom-desktop (the repro).
1. browser_scroll — { sessionId, tabId?, dy?, dx?, toSelector?, toText?, block?, behavior? }
Resolves the ACTUAL scroller (nearest ancestor with scrollHeight>clientHeight, not window). dy/dx = scroll by delta; toSelector/toText = scroll to element (pierces shadow DOM). block = start|center|end (default center). Returns { scrollElement, scrollTop, scrollLeft, scrollHeight, clientHeight, atBottom }.
2. browser_set_viewport — { sessionId, tabId?, width, height, deviceScaleFactor? }
Wraps page.setViewport (CDP device-metrics) — deterministic, independent of the OS window. Returns { applied, innerWidth, innerHeight, devicePixelRatio }. AND browser_open_window { width, height } now calls setViewport on open (verified innerWidth=1280, was ~170).
3. browser_screenshot_element — { sessionId, tabId?, selector?, text?, closest?, padding?, deep? }
Screenshot ONE element by CSS selector OR visible text (pierces shadow DOM), scrolled into view. Returns base64+filePath like browser_screenshot. closest climbs to the card container. Caveat learned live: text matches the tightest text node, and on adom-desktop the widget heading is split ("Download" + "for your machine") so only the README prose matches contiguously — for the widget, a selector (.download-card) is the reliable path (captured the exact 281×64 card). Fixed a below-fold clip bug (doc-relative rect + captureBeyondViewport).
4. fullPage nested-scroll — browser_screenshot { fullPage:true } now detects when the doc doesn't scroll but a nested container does, and returns nestedScroll:true + a _hint pointing to browser_screenshot_element / browser_scroll. (On adom-desktop the document DID scroll — 11981px — so it correctly did not false-fire.)
5. Shadow-DOM eval helpers — $deep(sel), $$deep(sel), deepText(txt) are auto-injected into every page (evaluateOnNewDocument + on-demand), so browser_eval pierces shadow roots with no hand-rolled walk. e.g. expr: "$$deep('a[href]').length".
Consumer skill updated (pup-screenshots-recording → "Driving & verifying tricky pages"). Reply here if you want any arg renamed before you wire the AD-side hints.
0 Replies
Log in to reply.