Skip to content

BrowserZap 0.5 is out on npm for Windows · Chrome Web Store listing in review · Get started

BrowserZap

Docs

Tools

Version 0.5.0 gives your agent 28 task-level tools; the next release adds 6 (marked). There is no "run this JavaScript" tool and there never will be.

Read the page

browser_statusIs the bridge up, is Chrome connected, which tab is the session on. Never starts Chrome.
page_inspectA compact snapshot: controls with role, name, state and context (row, card, form, dialog), headings and visible text. Never field values. Page text is labelled untrusted.
screenshot_captureA JPEG of the viewport or one element, on request only; saved on your computer.
page_consolenext releaseConsole messages, uncaught exceptions and the browser’s own messages, filtered by level or text.
page_networknext releaseThe page’s requests with status, timing, size and failures. No headers, cookies or bodies.

Act exactly

browser_navigateGo to an http(s) URL and wait until it is usable; reports redirects and HTTP errors.
element_clickClick exactly one element and report what changed. Ambiguous, hidden, disabled or covered targets are refused; risky clicks wait for your approval.
field_fillReplace a text field’s content or set a checkbox or radio. Sensitive fields are refused and handed to you.
select_optionPick a dropdown option by its exact label or value.
browser_press_keyOne allowed key (Enter, Tab, Escape, arrows…). Enter that submits a form needs the same approval as its button.
browser_scrollScroll the page or one element, bounded.
file_uploadnext releaseAttach one local file to a file input, after you approve that exact file. Secret-looking files are refused.
browser_downloadsnext releaseWhat the browser downloaded during the session: name, size, path, still downloading or complete; can wait for one to finish.

Wait and hand over

wait_for_stateWait for a URL, text or element to appear or disappear (up to 2 minutes, no fixed sleeps).
task_pauseHand the tab to you with a message; the page shows “Your turn”.
task_resumeWait for you to press Done, then look at the page again.

Tabs and profiles

browser_new_tabOpen a helper tab in the session’s group.
browser_list_tabsThe session’s tabs, with which is the main tab.
browser_switch_tabMove to another tab of this session.
browser_close_tabClose a helper tab and return to the main tab.
browser_set_session_nameLabel the session’s tab group.
browser_list_profilesThe Chrome profiles that are connected.
browser_select_profileChoose which profile (account) the session acts in.

Comment mode

feedback_listnext releaseComment batches you sent from the side panel.
feedback_getnext releaseOne batch: your notes, the elements, components and source files, and screenshots.

Workflows

workflow_recordStart, check, stop or discard recording this session’s steps.
workflow_saveSave a workflow from explicit steps.
workflow_listSaved workflows with their parameters.
workflow_getOne workflow’s steps.
workflow_runReplay a workflow with new values; every step gets the normal checks. Pro: many rows, background runs.
workflow_statusPro: progress and the compact result of a background run.
workflow_deleteDelete a workflow.
workflow_historyPro: versions and restore.
workflow_reportsPro: local run reports.

Targets

Most tools take a target. Use what the page shows a person:

{ "role": "button", "name": "Add to cart", "within": "Trail Runner 2" }
{ "label": "Email address" }
{ "text": "Show more" }
{ "ref": "e14" }   // from page_inspect, short-lived

Matching is exact and never guesses: zero matches is TARGET_NOT_FOUND, more than one is TARGET_AMBIGUOUS with the candidates and the within that would tell them apart.

What every result looks like

{
  "ok": true,
  "state": "completed",          // or "needs_user", "failed"
  "summary": "Clicked button \"Add to cart\" in \"Trail Runner 2\"; the page changed.",
  "evidence": { "verified": true, "urlChanged": false, "dialogOpened": false },
  "nextAction": null,
  "error": null
}

Read state, summary and nextAction every time; they say what to do next.

Error codes you will see most

CodeMeaningWhat to do
TARGET_AMBIGUOUSMore than one element matchesAdd within from the candidates
TARGET_NOT_FOUNDNothing matches (after waiting)Read likelyCause; inspect the page
USER_CONFIRMATION_REQUIREDNeeds your approvalApprove in the side panel, then repeat with approvalId
USER_ACTION_REQUIREDA password, code or CAPTCHADo it on the page, press Done
SITE_ERRORThe site showed its own error pageRetry later; nothing was assumed
POLICY_BLOCKEDNot allowed (site list, declined approval, secret file)Choose another way
PROFILE_REQUIREDSeveral Chrome profiles are connectedbrowser_select_profile
TIMEOUTWaited as long as allowedAllow more time (timeoutMs)