Browse
Browser automation via the agent-browser CLI. USE when a real browser is needed (login flows, screenshots, page interaction, DOM extraction). NOT for plain HTTP fetches. ALWAYS invoke via Bash tool — this is NOT an Agent subagent type, never pass it to Agent(subagent_type=...).From its SKILL.md
npx -y skills add kronael/tools --skill browseAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 6 stars6 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
5.6 KB, as published. Nobody here has run it
Browser Automation with agent-browser
Core workflow
agent-browser open <url>agent-browser snapshot -i(interactive elements with refs like@e1)- Interact using refs
- Re-snapshot after navigation or significant DOM changes
Commands
# Navigation
agent-browser open <url> | back | forward | reload | close
# Snapshot
agent-browser snapshot [-i interactive] [-c compact] [-d depth] [-s selector]
# Interact (use @refs from snapshot)
agent-browser click|dblclick|hover @e1
agent-browser fill @e2 "text" # Clear and type
agent-browser type @e2 "text" # Type without clearing
agent-browser press Enter
agent-browser check|uncheck @e1
agent-browser select @e1 "value"
agent-browser scroll down 500
agent-browser upload @e1 file.pdf
# Get info
agent-browser get text|html|value @e1
agent-browser get attr @e1 href
agent-browser get title|url
agent-browser get count ".item"
# Screenshot/PDF
agent-browser screenshot [path.png] [--full]
agent-browser pdf output.pdf
# Wait
agent-browser wait @e1 | 2000 | --text "Success" | --url "pattern" | --load networkidle
# Semantic locators (alternative to refs)
agent-browser find role button click --name "Submit"
agent-browser find text "Sign In" click
agent-browser find label "Email" fill "[email protected]"
# Auth state
agent-browser state save|load auth.json
# Storage
agent-browser cookies [set name value | clear]
agent-browser storage local [set k v]
agent-browser eval "document.title"
Rules
- ALWAYS
agent-browser wait --load networkidle(or wait --text/--url) BEFORE snapshot on dynamic pages; NEVER snapshot directly afteropenon SPAs — refs will be stale - ALWAYS prefer
find role --name,find text,find labelover numbered@eNrefs;@eNrefs are valid only within one snapshot — NEVER reuse across navigations - ALWAYS
agent-browser screenshot ./tmp/err.png --fullbefore reporting an unexpected failure
Coordinate clicks (canvas, maps, custom renderers)
ALWAYS use mouse for coordinate-based clicks. JS MouseEvent has
isTrusted=false and is blocked by security-conscious apps; mouse sends
real CDP input events with isTrusted=true.
agent-browser mouse move 930 120
agent-browser mouse down
agent-browser mouse up
Debugging: console, page errors, network, perf, memory
agent-browser snapshots and clicks but does NOT stream console logs, network,
or performance/heap. For DEBUGGING (console errors, "does scroll/interaction
refetch?", UI freezes, leaks) drive Playwright directly from a node script —
it exposes the CDP event streams agent-browser hides.
Setup once (browsers may be root-locked at the default /opt path → use a
writable local path):
export PLAYWRIGHT_BROWSERS_PATH=$PWD/tmp/pw
npx playwright install chromium-headless-shell # ~2MB, no sudo needed
Capture everything in one script (tmp/debug.mjs, run node tmp/debug.mjs):
import { chromium } from '@playwright/test'
const browser = await chromium.launch() // headless OK for logs
const page = await browser.newPage()
page.on('console', m => console.log(`[${m.type()}]`, m.text())) // console.* + warnings
page.on('pageerror', e => console.log('PAGEERROR', String(e))) // uncaught throws
page.on('requestfailed', r => console.log('REQFAIL', r.url()))
const net = []
page.on('request', r => net.push(r.url())) // count/inspect to test "refetch on X?"
await page.goto('http://localhost:5173/route', { waitUntil: 'domcontentloaded' })
await page.waitForSelector('tbody tr', { timeout: 60000 })
const before = net.length
// Reproduce the interaction; TIME each step — a hang shows as a long step.
const steps = []
for (let i = 0; i < 12; i++) {
const t0 = Date.now()
await page.mouse.move(720, 450); await page.mouse.wheel(0, 1200)
await page.waitForTimeout(120)
steps.push(Date.now() - t0)
}
console.log('step ms', steps, 'requests during interaction', net.length - before)
await browser.close()
- "Is it refetching on scroll/interaction?" — count
net.lengthbefore vs after; filter to the app's API hosts. Zero new requests ⇒ not a fetch problem. - UI freeze / jank — time each interaction step (above); or a CDP perf trace:
const cdp = await page.context().newCDPSession(page); await cdp.send('Performance.enable')then readPerformance.getMetricsbefore/after, orpage.evaluate(() => performance.getEntriesByType('longtask')). - Memory / leak growth —
const cdp = await page.context().newCDPSession(page); await cdp.send('Performance.enable'); const m = await cdp.send('Performance.getMetrics')→ readJSHeapUsedSize; sample it across repeated navigations to see if it climbs and never drops (a leak) vs plateaus (bounded).page.gotobetween samples. - Real APIs vs fixtures — a Vite dev server (
pnpm start:dev, :5173) hits live APIs, so network capture is meaningful;/test-*fixture routes issue no network. Pick the route that matches what you're testing.
Always npx tsc/build first if testing your own changes — a stale dev/preview build silently serves old code (a common "my fix didn't work" trap). Save artifacts under ./tmp.