agent-browser-stealth 0.17.0-fork.2 → 0.24.0-fork.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (122) hide show
  1. package/README.md +1256 -240
  2. package/bin/agent-browser-darwin-arm64 +0 -0
  3. package/bin/agent-browser-darwin-x64 +0 -0
  4. package/bin/agent-browser-linux-arm64 +0 -0
  5. package/bin/agent-browser-linux-x64 +0 -0
  6. package/bin/agent-browser-win32-x64.exe +0 -0
  7. package/bin/agent-browser.js +13 -2
  8. package/extensions/tab-group-cdp/content-script.js +425 -0
  9. package/extensions/tab-group-cdp/icons/icon.svg +7 -0
  10. package/extensions/tab-group-cdp/manifest.json +34 -0
  11. package/extensions/tab-group-cdp/page-bridge.js +133 -0
  12. package/extensions/tab-group-cdp/service-worker.js +2249 -0
  13. package/extensions/tab-group-cdp/sidepanel.css +258 -0
  14. package/extensions/tab-group-cdp/sidepanel.html +28 -0
  15. package/extensions/tab-group-cdp/sidepanel.js +1225 -0
  16. package/package.json +17 -69
  17. package/scripts/build-all-platforms.sh +6 -0
  18. package/scripts/check-version-sync.js +14 -2
  19. package/scripts/copy-native.js +8 -50
  20. package/scripts/postinstall.js +149 -165
  21. package/scripts/windows-debug/provision.sh +220 -0
  22. package/scripts/windows-debug/run.sh +92 -0
  23. package/scripts/windows-debug/start.sh +43 -0
  24. package/scripts/windows-debug/stop.sh +28 -0
  25. package/scripts/windows-debug/sync.sh +27 -0
  26. package/skills/agent-browser/SKILL.md +256 -159
  27. package/skills/agent-browser/references/authentication.md +101 -0
  28. package/skills/agent-browser/references/commands.md +34 -2
  29. package/skills/agent-browser/references/snapshot-refs.md +25 -0
  30. package/skills/agentcore/SKILL.md +115 -0
  31. package/skills/dogfood/SKILL.md +4 -2
  32. package/skills/electron/SKILL.md +26 -2
  33. package/skills/slack/SKILL.md +0 -9
  34. package/skills/slack/references/slack-tasks.md +2 -8
  35. package/skills/vercel-sandbox/SKILL.md +280 -0
  36. package/bin/agent-browser-local +0 -0
  37. package/bin/agent-browser-stealth +0 -0
  38. package/bin/agent-browser-stealth.d +0 -1
  39. package/dist/action-policy.d.ts +0 -14
  40. package/dist/action-policy.d.ts.map +0 -1
  41. package/dist/action-policy.js +0 -253
  42. package/dist/action-policy.js.map +0 -1
  43. package/dist/actions.d.ts +0 -21
  44. package/dist/actions.d.ts.map +0 -1
  45. package/dist/actions.js +0 -2139
  46. package/dist/actions.js.map +0 -1
  47. package/dist/auth-cli.d.ts +0 -2
  48. package/dist/auth-cli.d.ts.map +0 -1
  49. package/dist/auth-cli.js +0 -97
  50. package/dist/auth-cli.js.map +0 -1
  51. package/dist/auth-vault.d.ts +0 -36
  52. package/dist/auth-vault.d.ts.map +0 -1
  53. package/dist/auth-vault.js +0 -125
  54. package/dist/auth-vault.js.map +0 -1
  55. package/dist/browser.d.ts +0 -665
  56. package/dist/browser.d.ts.map +0 -1
  57. package/dist/browser.js +0 -3210
  58. package/dist/browser.js.map +0 -1
  59. package/dist/confirmation.d.ts +0 -8
  60. package/dist/confirmation.d.ts.map +0 -1
  61. package/dist/confirmation.js +0 -30
  62. package/dist/confirmation.js.map +0 -1
  63. package/dist/daemon.d.ts +0 -78
  64. package/dist/daemon.d.ts.map +0 -1
  65. package/dist/daemon.js +0 -744
  66. package/dist/daemon.js.map +0 -1
  67. package/dist/diff.d.ts +0 -18
  68. package/dist/diff.d.ts.map +0 -1
  69. package/dist/diff.js +0 -271
  70. package/dist/diff.js.map +0 -1
  71. package/dist/domain-filter.d.ts +0 -28
  72. package/dist/domain-filter.d.ts.map +0 -1
  73. package/dist/domain-filter.js +0 -149
  74. package/dist/domain-filter.js.map +0 -1
  75. package/dist/encryption.d.ts +0 -73
  76. package/dist/encryption.d.ts.map +0 -1
  77. package/dist/encryption.js +0 -171
  78. package/dist/encryption.js.map +0 -1
  79. package/dist/ios-actions.d.ts +0 -11
  80. package/dist/ios-actions.d.ts.map +0 -1
  81. package/dist/ios-actions.js +0 -228
  82. package/dist/ios-actions.js.map +0 -1
  83. package/dist/ios-manager.d.ts +0 -266
  84. package/dist/ios-manager.d.ts.map +0 -1
  85. package/dist/ios-manager.js +0 -1073
  86. package/dist/ios-manager.js.map +0 -1
  87. package/dist/protocol.d.ts +0 -26
  88. package/dist/protocol.d.ts.map +0 -1
  89. package/dist/protocol.js +0 -990
  90. package/dist/protocol.js.map +0 -1
  91. package/dist/snapshot.d.ts +0 -67
  92. package/dist/snapshot.d.ts.map +0 -1
  93. package/dist/snapshot.js +0 -514
  94. package/dist/snapshot.js.map +0 -1
  95. package/dist/state-utils.d.ts +0 -77
  96. package/dist/state-utils.d.ts.map +0 -1
  97. package/dist/state-utils.js +0 -178
  98. package/dist/state-utils.js.map +0 -1
  99. package/dist/stealth.d.ts +0 -41
  100. package/dist/stealth.d.ts.map +0 -1
  101. package/dist/stealth.js +0 -1743
  102. package/dist/stealth.js.map +0 -1
  103. package/dist/stream-server.d.ts +0 -117
  104. package/dist/stream-server.d.ts.map +0 -1
  105. package/dist/stream-server.js +0 -309
  106. package/dist/stream-server.js.map +0 -1
  107. package/dist/types.d.ts +0 -973
  108. package/dist/types.d.ts.map +0 -1
  109. package/dist/types.js +0 -2
  110. package/dist/types.js.map +0 -1
  111. package/scripts/check-creepjs-headless.js +0 -137
  112. package/scripts/check-daemon-pid-recovery.js +0 -148
  113. package/scripts/check-sannysoft-webdriver.js +0 -112
  114. package/scripts/check-stealth-regression.js +0 -199
  115. package/scripts/check-turnstile-testkey.ts +0 -125
  116. package/scripts/clawhub-sync.sh +0 -27
  117. package/scripts/sync-upstream.sh +0 -142
  118. package/scripts/verify-bundled-binaries.js +0 -71
  119. package/scripts/verify-native-version.js +0 -48
  120. package/scripts/verify-packed-host-binary.js +0 -88
  121. package/scripts/verify-registry-host-binary.js +0 -120
  122. package/skills/agent-browser-stealth/SKILL.md +0 -127
@@ -6,6 +6,9 @@ Login flows, session persistence, OAuth, 2FA, and authenticated browsing.
6
6
 
7
7
  ## Contents
8
8
 
9
+ - [Import Auth from Your Browser](#import-auth-from-your-browser)
10
+ - [Persistent Profiles](#persistent-profiles)
11
+ - [Session Persistence](#session-persistence)
9
12
  - [Basic Login Flow](#basic-login-flow)
10
13
  - [Saving Authentication State](#saving-authentication-state)
11
14
  - [Restoring Authentication](#restoring-authentication)
@@ -16,6 +19,104 @@ Login flows, session persistence, OAuth, 2FA, and authenticated browsing.
16
19
  - [Token Refresh Handling](#token-refresh-handling)
17
20
  - [Security Best Practices](#security-best-practices)
18
21
 
22
+ ## Import Auth from Your Browser
23
+
24
+ The fastest way to authenticate is to reuse cookies from a Chrome session you are already logged into.
25
+
26
+ **Step 1: Start Chrome with remote debugging**
27
+
28
+ ```bash
29
+ # macOS
30
+ "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" --remote-debugging-port=9222
31
+
32
+ # Linux
33
+ google-chrome --remote-debugging-port=9222
34
+
35
+ # Windows
36
+ "C:\Program Files\Google\Chrome\Application\chrome.exe" --remote-debugging-port=9222
37
+ ```
38
+
39
+ Log in to your target site(s) in this Chrome window as you normally would.
40
+
41
+ > **Security note:** `--remote-debugging-port` exposes full browser control on localhost. Any local process can connect and read cookies, execute JS, etc. Only use on trusted machines and close Chrome when done.
42
+
43
+ **Step 2: Grab the auth state**
44
+
45
+ ```bash
46
+ # Auto-discover the running Chrome and save its cookies + localStorage
47
+ agent-browser --auto-connect state save ./my-auth.json
48
+ ```
49
+
50
+ **Step 3: Reuse in automation**
51
+
52
+ ```bash
53
+ # Load auth at launch
54
+ agent-browser --state ./my-auth.json open https://app.example.com/dashboard
55
+
56
+ # Or load into an existing session
57
+ agent-browser state load ./my-auth.json
58
+ agent-browser open https://app.example.com/dashboard
59
+ ```
60
+
61
+ This works for any site, including those with complex OAuth flows, SSO, or 2FA -- as long as Chrome already has valid session cookies.
62
+
63
+ > **Security note:** State files contain session tokens in plaintext. Add them to `.gitignore`, delete when no longer needed, and set `AGENT_BROWSER_ENCRYPTION_KEY` for encryption at rest. See [Security Best Practices](#security-best-practices).
64
+
65
+ **Tip:** Combine with `--session-name` so the imported auth auto-persists across restarts:
66
+
67
+ ```bash
68
+ agent-browser --session-name myapp state load ./my-auth.json
69
+ # From now on, state is auto-saved/restored for "myapp"
70
+ ```
71
+
72
+ ## Persistent Profiles
73
+
74
+ Use `--profile` to point agent-browser at a Chrome user data directory. This persists everything (cookies, IndexedDB, service workers, cache) across browser restarts without explicit save/load:
75
+
76
+ ```bash
77
+ # First run: login once
78
+ agent-browser --profile ~/.myapp-profile open https://app.example.com/login
79
+ # ... complete login flow ...
80
+
81
+ # All subsequent runs: already authenticated
82
+ agent-browser --profile ~/.myapp-profile open https://app.example.com/dashboard
83
+ ```
84
+
85
+ Use different paths for different projects or test users:
86
+
87
+ ```bash
88
+ agent-browser --profile ~/.profiles/admin open https://app.example.com
89
+ agent-browser --profile ~/.profiles/viewer open https://app.example.com
90
+ ```
91
+
92
+ Or set via environment variable:
93
+
94
+ ```bash
95
+ export AGENT_BROWSER_PROFILE=~/.myapp-profile
96
+ agent-browser open https://app.example.com/dashboard
97
+ ```
98
+
99
+ ## Session Persistence
100
+
101
+ Use `--session-name` to auto-save and restore cookies + localStorage by name, without managing files:
102
+
103
+ ```bash
104
+ # Auto-saves state on close, auto-restores on next launch
105
+ agent-browser --session-name twitter open https://twitter.com
106
+ # ... login flow ...
107
+ agent-browser close # state saved to ~/.agent-browser/sessions/
108
+
109
+ # Next time: state is automatically restored
110
+ agent-browser --session-name twitter open https://twitter.com
111
+ ```
112
+
113
+ Encrypt state at rest:
114
+
115
+ ```bash
116
+ export AGENT_BROWSER_ENCRYPTION_KEY=$(openssl rand -hex 32)
117
+ agent-browser --session-name secure open https://app.example.com
118
+ ```
119
+
19
120
  ## Basic Login Flow
20
121
 
21
122
  ```bash
@@ -58,6 +58,7 @@ agent-browser get value @e1 # Get input value
58
58
  agent-browser get attr @e1 href # Get attribute
59
59
  agent-browser get title # Get page title
60
60
  agent-browser get url # Get current URL
61
+ agent-browser get cdp-url # Get CDP WebSocket URL
61
62
  agent-browser get count ".item" # Count matching elements
62
63
  agent-browser get box @e1 # Get bounding box
63
64
  agent-browser get styles @e1 # Get computed styles (font, color, bg, etc.)
@@ -129,6 +130,7 @@ agent-browser find nth 2 "a" hover
129
130
 
130
131
  ```bash
131
132
  agent-browser set viewport 1920 1080 # Set viewport size
133
+ agent-browser set viewport 1920 1080 2 # 2x retina (same CSS size, higher res screenshots)
132
134
  agent-browser set device "iPhone 14" # Emulate device
133
135
  agent-browser set geo 37.7749 -122.4194 # Set geolocation (alias: geolocation)
134
136
  agent-browser set offline on # Toggle offline mode
@@ -175,15 +177,44 @@ agent-browser window new # New window
175
177
  ## Frames
176
178
 
177
179
  ```bash
178
- agent-browser frame "#iframe" # Switch to iframe
180
+ agent-browser frame "#iframe" # Switch to iframe by CSS selector
181
+ agent-browser frame @e3 # Switch to iframe by element ref
179
182
  agent-browser frame main # Back to main frame
180
183
  ```
181
184
 
185
+ ### Iframe support
186
+
187
+ Iframes are detected automatically during snapshots. When the main-frame snapshot runs, `Iframe` nodes are resolved and their content is inlined beneath the iframe element in the output (one level of nesting; iframes within iframes are not expanded).
188
+
189
+ ```bash
190
+ agent-browser snapshot -i
191
+ # @e3 [Iframe] "payment-frame"
192
+ # @e4 [input] "Card number"
193
+ # @e5 [button] "Pay"
194
+
195
+ # Interact directly — refs inside iframes already work
196
+ agent-browser fill @e4 "4111111111111111"
197
+ agent-browser click @e5
198
+
199
+ # Or switch frame context for scoped snapshots
200
+ agent-browser frame @e3 # Switch using element ref
201
+ agent-browser snapshot -i # Snapshot scoped to that iframe
202
+ agent-browser frame main # Return to main frame
203
+ ```
204
+
205
+ The `frame` command accepts:
206
+ - **Element refs** — `frame @e3` resolves the ref to an iframe element
207
+ - **CSS selectors** — `frame "#payment-iframe"` finds the iframe by selector
208
+ - **Frame name/URL** — matches against the browser's frame tree
209
+
182
210
  ## Dialogs
183
211
 
212
+ By default, `alert` and `beforeunload` dialogs are automatically accepted so they never block the agent. `confirm` and `prompt` dialogs still require explicit handling. Use `--no-auto-dialog` to disable this behavior.
213
+
184
214
  ```bash
185
215
  agent-browser dialog accept [text] # Accept dialog
186
216
  agent-browser dialog dismiss # Dismiss dialog
217
+ agent-browser dialog status # Check if a dialog is currently open
187
218
  ```
188
219
 
189
220
  ## JavaScript
@@ -245,6 +276,7 @@ agent-browser console --clear # Clear console
245
276
  agent-browser errors # View page errors
246
277
  agent-browser errors --clear # Clear errors
247
278
  agent-browser highlight @e1 # Highlight element
279
+ agent-browser inspect # Open Chrome DevTools for this session
248
280
  agent-browser trace start # Start recording trace
249
281
  agent-browser trace stop trace.zip # Stop and save trace
250
282
  agent-browser profiler start # Start Chrome DevTools profiling
@@ -258,6 +290,6 @@ AGENT_BROWSER_SESSION="mysession" # Default session name
258
290
  AGENT_BROWSER_EXECUTABLE_PATH="/path/chrome" # Custom browser path
259
291
  AGENT_BROWSER_EXTENSIONS="/ext1,/ext2" # Comma-separated extension paths
260
292
  AGENT_BROWSER_PROVIDER="browserbase" # Cloud browser provider
261
- AGENT_BROWSER_STREAM_PORT="9223" # WebSocket streaming port
293
+ AGENT_BROWSER_STREAM_PORT="9223" # Override WebSocket streaming port (default: OS-assigned)
262
294
  AGENT_BROWSER_HOME="/path/to/agent-browser" # Custom install location
263
295
  ```
@@ -162,6 +162,31 @@ agent-browser snapshot @e9
162
162
  @e10 [radio] selected # Selected radio
163
163
  ```
164
164
 
165
+ ## Iframes
166
+
167
+ Snapshots automatically detect and inline iframe content. When the main-frame snapshot runs, each `Iframe` node is resolved and its child accessibility tree is included directly beneath it in the output. Refs assigned to elements inside iframes carry frame context, so interactions like `click`, `fill`, and `type` work without manually switching frames.
168
+
169
+ ```bash
170
+ agent-browser snapshot -i
171
+ # @e1 [heading] "Checkout"
172
+ # @e2 [Iframe] "payment-frame"
173
+ # @e3 [input] "Card number"
174
+ # @e4 [input] "Expiry"
175
+ # @e5 [button] "Pay"
176
+ # @e6 [button] "Cancel"
177
+
178
+ # Interact with iframe elements directly using their refs
179
+ agent-browser fill @e3 "4111111111111111"
180
+ agent-browser fill @e4 "12/28"
181
+ agent-browser click @e5
182
+ ```
183
+
184
+ **Key details:**
185
+ - Only one level of iframe nesting is expanded (iframes within iframes are not recursed)
186
+ - Cross-origin iframes that block accessibility tree access are silently skipped
187
+ - Empty iframes or iframes with no interactive content are omitted from the output
188
+ - To scope a snapshot to a single iframe, use `frame @ref` then `snapshot -i`
189
+
165
190
  ## Troubleshooting
166
191
 
167
192
  ### "Ref not found" Error
@@ -0,0 +1,115 @@
1
+ ---
2
+ name: agentcore
3
+ description: Run agent-browser on AWS Bedrock AgentCore cloud browsers. Use when the user wants to use AgentCore, run browser automation on AWS, use a cloud browser with AWS credentials, or needs a managed browser session backed by AWS infrastructure. Triggers include "use agentcore", "run on AWS", "cloud browser with AWS", "bedrock browser", "agentcore session", or any task requiring AWS-hosted browser automation.
4
+ allowed-tools: Bash(agent-browser:*), Bash(npx agent-browser:*)
5
+ ---
6
+
7
+ # AWS Bedrock AgentCore
8
+
9
+ Run agent-browser on cloud browser sessions hosted by AWS Bedrock AgentCore. All standard agent-browser commands work identically; the only difference is where the browser runs.
10
+
11
+ ## Setup
12
+
13
+ Credentials are resolved automatically:
14
+
15
+ 1. Environment variables (`AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, optionally `AWS_SESSION_TOKEN`)
16
+ 2. AWS CLI fallback (`aws configure export-credentials`), which supports SSO, IAM roles, and named profiles
17
+
18
+ No additional setup is needed if the user already has working AWS credentials.
19
+
20
+ ## Core Workflow
21
+
22
+ ```bash
23
+ # Open a page on an AgentCore cloud browser
24
+ agent-browser -p agentcore open https://example.com
25
+
26
+ # Everything else is the same as local Chrome
27
+ agent-browser snapshot -i
28
+ agent-browser click @e1
29
+ agent-browser screenshot page.png
30
+ agent-browser close
31
+ ```
32
+
33
+ ## Environment Variables
34
+
35
+ | Variable | Description | Default |
36
+ |----------|-------------|---------|
37
+ | `AGENTCORE_REGION` | AWS region | `us-east-1` |
38
+ | `AGENTCORE_BROWSER_ID` | Browser identifier | `aws.browser.v1` |
39
+ | `AGENTCORE_PROFILE_ID` | Persistent browser profile (cookies, localStorage) | (none) |
40
+ | `AGENTCORE_SESSION_TIMEOUT` | Session timeout in seconds | `3600` |
41
+ | `AWS_PROFILE` | AWS CLI profile for credential resolution | `default` |
42
+
43
+ ## Persistent Profiles
44
+
45
+ Use `AGENTCORE_PROFILE_ID` to persist browser state across sessions. This is useful for maintaining login sessions:
46
+
47
+ ```bash
48
+ # First run: log in
49
+ AGENTCORE_PROFILE_ID=my-app agent-browser -p agentcore open https://app.example.com/login
50
+ agent-browser snapshot -i
51
+ agent-browser fill @e1 "user@example.com"
52
+ agent-browser fill @e2 "password"
53
+ agent-browser click @e3
54
+ agent-browser close
55
+
56
+ # Future runs: already authenticated
57
+ AGENTCORE_PROFILE_ID=my-app agent-browser -p agentcore open https://app.example.com/dashboard
58
+ ```
59
+
60
+ ## Live View
61
+
62
+ When a session starts, AgentCore prints a Live View URL to stderr. Open it in a browser to watch the session in real time from the AWS Console:
63
+
64
+ ```
65
+ Session: abc123-def456
66
+ Live View: https://us-east-1.console.aws.amazon.com/bedrock-agentcore/browser/aws.browser.v1/session/abc123-def456#
67
+ ```
68
+
69
+ ## Region Selection
70
+
71
+ ```bash
72
+ # Default: us-east-1
73
+ agent-browser -p agentcore open https://example.com
74
+
75
+ # Explicit region
76
+ AGENTCORE_REGION=eu-west-1 agent-browser -p agentcore open https://example.com
77
+ ```
78
+
79
+ ## Credential Patterns
80
+
81
+ ```bash
82
+ # Explicit credentials (CI/CD, scripts)
83
+ export AWS_ACCESS_KEY_ID=AKIA...
84
+ export AWS_SECRET_ACCESS_KEY=...
85
+ agent-browser -p agentcore open https://example.com
86
+
87
+ # SSO (interactive)
88
+ aws sso login --profile my-profile
89
+ AWS_PROFILE=my-profile agent-browser -p agentcore open https://example.com
90
+
91
+ # IAM role / default credential chain
92
+ agent-browser -p agentcore open https://example.com
93
+ ```
94
+
95
+ ## Using with AGENT_BROWSER_PROVIDER
96
+
97
+ Set the provider via environment variable to avoid passing `-p agentcore` on every command:
98
+
99
+ ```bash
100
+ export AGENT_BROWSER_PROVIDER=agentcore
101
+ export AGENTCORE_REGION=us-east-2
102
+
103
+ agent-browser open https://example.com
104
+ agent-browser snapshot -i
105
+ agent-browser click @e1
106
+ agent-browser close
107
+ ```
108
+
109
+ ## Common Issues
110
+
111
+ **"Failed to run aws CLI"** means AWS CLI is not installed or not in PATH. Either install it or set `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` directly.
112
+
113
+ **"AWS CLI failed: ... Run 'aws sso login'"** means SSO credentials have expired. Run `aws sso login` to refresh them.
114
+
115
+ **Session timeout:** The default is 3600 seconds (1 hour). For longer tasks, increase with `AGENTCORE_SESSION_TIMEOUT=7200`.
@@ -190,11 +190,13 @@ agent-browser --session {SESSION} close
190
190
  ## Guidance
191
191
 
192
192
  - **Repro is everything.** Every issue needs proof -- but match the evidence to the issue. Interactive bugs need video and step-by-step screenshots. Static bugs (typos, placeholder text, visual glitches visible on load) only need a single annotated screenshot.
193
- - **Verify reproducibility before collecting evidence.** Before recording video or taking screenshots, verify the issue is reproducible with at least one retry. If it cannot be reproduced consistently, do not report it as a confirmed issue.
193
+ - **Verify reproducibility before collecting evidence.** Before recording video or taking screenshots, verify the issue is reproducible with at least one retry. If it can't be reproduced consistently, it's not a valid issue.
194
194
  - **Don't record video for static issues.** A typo or clipped text doesn't benefit from a video. Save video for issues that involve user interaction, timing, or state changes.
195
195
  - **For interactive issues, screenshot each step.** Capture the before, the action, and the after -- so someone can see the full sequence.
196
196
  - **Write repro steps that map to screenshots.** Each numbered step in the report should reference its corresponding screenshot. A reader should be able to follow the steps visually without touching a browser.
197
- - **Use the right snapshot command.** Use `snapshot -i` to find clickable or fillable elements. Use plain `snapshot` when you need readable page content such as text, headings, or data lists.
197
+ - **Use the right snapshot command.**
198
+ - `snapshot -i` — for finding clickable/fillable elements (buttons, inputs, links)
199
+ - `snapshot` (no flag) — for reading page content (text, headings, data lists)
198
200
  - **Be thorough but use judgment.** You are not following a test script -- you are exploring like a real user would. If something feels off, investigate.
199
201
  - **Write findings incrementally.** Append each issue to the report as you discover it. If the session is interrupted, findings are preserved. Never batch all issues for the end.
200
202
  - **Never delete output files.** Do not `rm` screenshots, videos, or the report mid-session. Do not close the session and restart. Work forward, not backward.
@@ -102,6 +102,31 @@ agent-browser tab 2
102
102
  agent-browser tab --url "*settings*"
103
103
  ```
104
104
 
105
+ ## Webview Support
106
+
107
+ Electron `<webview>` elements are automatically discovered and can be controlled like regular pages. Webviews appear as separate targets in the tab list with `type: "webview"`:
108
+
109
+ ```bash
110
+ # Connect to running Electron app
111
+ agent-browser connect 9222
112
+
113
+ # List targets -- webviews appear alongside pages
114
+ agent-browser tab
115
+ # Example output:
116
+ # 0: [page] Slack - Main Window https://app.slack.com/
117
+ # 1: [webview] Embedded Content https://example.com/widget
118
+
119
+ # Switch to a webview
120
+ agent-browser tab 1
121
+
122
+ # Interact with the webview normally
123
+ agent-browser snapshot -i
124
+ agent-browser click @e3
125
+ agent-browser screenshot webview.png
126
+ ```
127
+
128
+ **Note:** Webview support works via raw CDP connection.
129
+
105
130
  ## Common Patterns
106
131
 
107
132
  ### Inspect and Navigate an App
@@ -163,7 +188,7 @@ agent-browser --session vscode snapshot -i
163
188
 
164
189
  ## Color Scheme
165
190
 
166
- Playwright overrides the color scheme to `light` by default when connecting via CDP. To preserve dark mode:
191
+ The default color scheme when connecting via CDP may be `light`. To preserve dark mode:
167
192
 
168
193
  ```bash
169
194
  agent-browser connect 9222
@@ -192,7 +217,6 @@ AGENT_BROWSER_COLOR_SCHEME=dark agent-browser connect 9222
192
217
  ### Elements not appearing in snapshot
193
218
 
194
219
  - The app may use multiple webviews. Use `agent-browser tab` to list targets and switch to the right one
195
- - Use `agent-browser snapshot -i -C` to include cursor-interactive elements (divs with onclick handlers)
196
220
 
197
221
  ### Cannot type in input fields
198
222
 
@@ -235,15 +235,6 @@ agent-browser console
235
235
  agent-browser errors
236
236
  ```
237
237
 
238
- ### View raw HTML of an element
239
-
240
- ```bash
241
- # Snapshot shows the accessibility tree. If an element isn't there,
242
- # it may not be interactive (e.g., div instead of button)
243
- # Use snapshot -i -C to include cursor-interactive divs
244
- agent-browser snapshot -i -C
245
- ```
246
-
247
238
  ### Get current page state
248
239
 
249
240
  ```bash
@@ -334,19 +334,13 @@ If you can't find an element:
334
334
  agent-browser snapshot -i
335
335
  ```
336
336
 
337
- 3. **Try snapshot with extended range**
338
- ```bash
339
- # Include cursor-interactive elements (divs with onclick handlers)
340
- agent-browser snapshot -i -C
341
- ```
342
-
343
- 4. **Check current URL**
337
+ 3. **Check current URL**
344
338
  ```bash
345
339
  agent-browser get url
346
340
  # Verify you're in the right section
347
341
  ```
348
342
 
349
- 5. **Wait for page to load**
343
+ 4. **Wait for page to load**
350
344
  ```bash
351
345
  agent-browser wait --load networkidle
352
346
  agent-browser wait 1000