main
md 97 lines 4.43 KB
Rendered Raw
1 ---
2 name: browser-automation
3 description: Use for complex Agent Zero browser automation, including multi-tab browsing, screenshots, forms, uploads, raw pointer/keyboard actions, host-vs-container browser mode, and visual verification workflows.
4 triggers:
5 - "browser automation"
6 - "web automation"
7 - "open website"
8 - "open URL"
9 - "navigate browser"
10 - "interact with web page"
11 - "JavaScript page"
12 - "browser screenshot"
13 - "screenshot webpage"
14 - "visual verification"
15 - "multi-tab browsing"
16 - "download file from website"
17 - "upload file in browser"
18 - "host browser"
19 - "local browser"
20 - "my browser"
21 ---
22
23 # Browser Tool
24
25 Use this skill after the compact `browser` tool prompt points you here. It is the progressive-disclosure workflow guide for rendered pages, multi-step browser work, logins, downloads, JavaScript-heavy sites, screenshots, host/container browser mode, and visual inspection. Prefer `search_engine` or `document_query` for plain text research.
26
27 For fragile forms, load `browser-form-workflows` with `skills_tool:load` before acting when selects, checkboxes, radios, file uploads, contenteditable fields, validation, or final submission state are central to the task.
28
29 ## Core Workflow
30
31 1. `open` creates a browser tab and returns a `browser_id`.
32 2. `content` returns readable markdown plus typed refs like `[link 3]`, `[button 6]`, `[input text 8]`.
33 3. Interact with refs using `click`, `type`, `submit`, `scroll`, etc.; iframe/shadow targets may return frame-chain metadata in action results.
34 4. Use `navigate` on an existing `browser_id` for serial browsing.
35 5. Keep only a small working tab set; close pages when finished.
36 6. If the user asks for an existing tab, page title, or already-open URL, call `list` first, match by `title` or `currentUrl`, then use `set_active` or `navigate` on that `browser_id` instead of opening a new tab.
37
38 ## Modes
39
40 The same tool may run in Docker container mode or A0 CLI host-browser mode, depending on project/plugin settings.
41
42 - Container mode: browser and upload paths resolve inside the Agent Zero container.
43 - Host mode: browser and upload paths resolve on the connected A0 CLI host machine.
44
45 In host mode, page content and screenshots may be blocked by host-content policy when remote models are active.
46
47 ## Screenshots And Vision
48
49 Screenshots are explicit only; the browser does not automatically load images into model context.
50
51 1. Call `browser` with `action: "screenshot"`.
52 2. Call `vision_load` with the returned `vision_load.tool_args.paths` value.
53 3. Reason from the latest loaded screenshot.
54
55 Screenshot args include `quality`, `full_page`, and optional `path`. Without `path`, the screenshot is saved as a chat-scoped artifact and returned through `vision_load.tool_args.paths`; with `path`, PNG is used when `path` ends with `.png`, otherwise JPEG is used.
56
57 ## Forms And Files
58
59 - `select_option` works for native selects and detectable ARIA listbox/combobox controls.
60 - `set_checked` works for checkbox, radio, switch, and toggle-like refs.
61 - `upload_file` works for file input refs or associated labels; verify the file exists in the active browser environment.
62 - For fragile forms, call `skills_tool` with `action: "load"` and `skill_name: "browser-form-workflows"`, then follow that form-specific workflow before filling or submitting.
63
64 ## Pointer And Keyboard
65
66 - Prefer refs/selectors and DOM/CDP actions over viewport coordinates.
67 - `hover`, `double_click`, `right_click`, and `drag` accept refs or viewport coordinates when no reliable ref exists.
68 - Coordinates are Chromium viewport CSS pixels and match screenshots; treat them as visual fallback, not the default interaction path.
69 - `key_chord` presses keys in order and releases in reverse.
70 - `clipboard` actions are copy, cut, or paste.
71 - `set_viewport` resizes the page viewport.
72
73 ## Tabs And Popups
74
75 - Popups and target-blank tabs are auto-registered.
76 - `list` shows open tabs; pass `include_content: true` sparingly.
77 - `set_active` deliberately changes focus.
78 - Operations on a non-active tab do not steal focus unless browser rules require it.
79
80 ## Browser Action Multi
81
82 `multi` is only a browser action, never a top-level tool. Use:
83
84 ```json
85 {
86 "tool_name": "browser",
87 "tool_args": {
88 "action": "multi",
89 "calls": [
90 {"action": "content", "browser_id": 1},
91 {"action": "screenshot", "browser_id": 2}
92 ]
93 }
94 }
95 ```
96
97 Use browser action `multi` for parallel reads across tabs. Avoid mutating the same tab twice in one batch unless serial order is intended.