Skip to content

Commit 7f37345

Browse files
authored
Merge pull request #124 from browser-use/screenshot-attach-optout
docs(browser): document the screenshot auto-attach escape hatch
2 parents bf190ce + da8b535 commit 7f37345

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

  • packages/bcode-browser/skills/browser-execute

packages/bcode-browser/skills/browser-execute/SKILL.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,21 @@ await session.Page.captureScreenshot({ format: "png" })
149149
150150
`Page.navigate` can return a non-empty `errorText` instead of throwing. Treat it as a failed navigation. If `ERR_TUNNEL_CONNECTION_FAILED` persists, reloading, reattaching, or reconnecting to the same endpoint cannot change its proxy route; use another source or replace the cloud browser instead of retrying it.
151151
152+
Not auto-attaching a screenshot: attachment is keyed on the `Page.captureScreenshot` response; pixels that arrive as an event are never attached.
153+
154+
```js
155+
await session.Page.enable()
156+
// Optional: screencast has no `clip`, so override the viewport for exact frame size.
157+
await session.Emulation.setDeviceMetricsOverride({ width: 1200, height: 630, deviceScaleFactor: 1, mobile: false })
158+
const frame = session.waitFor("Page.screencastFrame", { timeoutMs: 10_000 }) // register first
159+
await session.Page.startScreencast({ format: "png" })
160+
try {
161+
const f = await frame // f.data is base64, same as captureScreenshot
162+
} finally {
163+
await session.Page.stopScreencast() // otherwise the cast stays open
164+
}
165+
```
166+
152167
## Reusing code
153168
The agent-workspace is per-project: `./.bcode/agent-workspace/`.
154169
Use this to write memory files, scripts, and helper functions.

0 commit comments

Comments
 (0)