browser-skill
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesebrowser-skill
browser-skill
Use to work in an Agent Window with the user's existing logins. User tabs
require explicit borrowing. This skill does not install the extension or handle
advice-only tasks. Never extract credentials, cookies, tokens, or other secrets.
bsk使用在Agent Window中利用用户现有的登录状态进行操作。用户标签页需要明确借用。此skill不负责安装扩展或处理仅咨询类任务。切勿提取凭据、cookie、token或其他秘密信息。
bskBefore starting a session
会话开始前
For remote setup or pairing, follow the remote guide.
Local commands normally auto-start the daemon. If the host terminates background
children after each shell call, including on Windows, complete these steps first:
- Reuse the host daemon's existing (or its default if unset). Set
BSK_HOMEand runBSK_AUTO_START=0. Reuse a working daemon; an emptybsk status --jsonlist means the extension still needs connecting. Permission errors, timeouts or invalid replies do not prove the daemon is absent.browsers - Only if the check reports a missing daemon and no host task is already starting
it, run with the same
bsk daemon start --foregroundin the host's approved persistent background task outside the per-command sandbox. Keep that task alive;BSK_HOMEalone cannot prevent host cleanup. The sandbox guide covers the normal host-terminal alternative and PowerShell examples.--foreground - After launching, or if a host task is already starting the daemon, run
in a separate shell tool call with the same
bsk status --jsonandBSK_HOME. While startup is pending, make at most five checks with one-second pauses for missing-endpoint or transient startup errors; stop on permission/protocol errors. Proceed only after a successful status response. If the host task exits (including a lock error) or readiness never succeeds, inspect its output andBSK_AUTO_START=0, then recheck status for another daemon before deciding whether startup is still needed. Report unresolved errors; do not loop on launches, delete runtime files or restart a shared daemon.bsk logs
Use the same and on EVERY sandboxed command;
environment settings may not persist between shell calls. Keep browser commands
sandboxed. For other startup failures, retry once, then use .
A local process identity warning permits browser commands when IPC works.
BSK_HOMEBSK_AUTO_START=0bsk doctor对于远程设置或配对,请遵循远程指南。
本地命令通常会自动启动守护进程。如果主机在每次shell调用后终止后台子进程(包括Windows系统),请先完成以下步骤:
- 复用主机守护进程现有的(若未设置则使用默认值)。设置
BSK_HOME并运行BSK_AUTO_START=0。复用正在运行的守护进程;空的bsk status --json列表表示扩展仍需连接。权限错误、超时或无效回复并不能证明守护进程不存在。browsers - 仅当检查报告守护进程缺失且没有主机任务已在启动它时,在每命令沙箱之外的主机批准的持久后台任务中,使用相同的运行
BSK_HOME。保持该任务存活;bsk daemon start --foreground本身无法防止主机清理。 沙箱指南涵盖了常规主机终端替代方案和PowerShell示例。--foreground - 启动后,或如果主机任务已在启动守护进程,在单独的shell工具调用中使用相同的和
BSK_HOME运行BSK_AUTO_START=0。在启动待处理期间,对于缺失端点或瞬时启动错误最多检查五次,每次间隔一秒;遇到权限/协议错误时停止。仅在成功收到状态响应后继续。如果主机任务退出(包括锁错误)或就绪状态始终未成功,请检查其输出和bsk status --json,然后重新检查状态以确认是否有其他守护进程,再决定是否仍需启动。报告未解决的错误;不要循环启动、删除运行时文件或重启共享守护进程。bsk logs
在每个沙箱命令中都使用相同的和;环境设置可能不会在shell调用之间持久化。保持浏览器命令在沙箱中运行。对于其他启动失败,重试一次,然后使用。
当IPC正常工作时,本地进程身份警告允许执行浏览器命令。
BSK_HOMEBSK_AUTO_START=0bsk doctorTask workflow
任务工作流
-
Define success from the user's request. Startand retain its
bsk session start --json. With multiple browsers, runsession_idand addbsk browsersto start. For background work, add--browser <id-or-label>to--no-focusonly.session start -
For a new page, navigate; for an existing user tab, follow Borrowing below. Read the page before interacting:sh
bsk navigate https://example.com --session <id> bsk observe --session <id> -
Choose an action using fresh refs from that observation. Observe again after navigation or meaningful DOM changes. Check an ambiguous result once; once success is visible, stop acting rather than refreshing or checking again.
-
Always runon success and failure, unless keeping the session open is part of the user's request. This also returns borrowed tabs. Returned tabs stay open in the user's window. Do not rely on idle cleanup or stop/restart the shared daemon to finish a task.
bsk session stop <id>
Replace , example refs and values with actual results and task inputs.
Every session-scoped command needs ; takes the ID
positionally. For unfamiliar commands or flags, consult or
instead of guessing; no need to read all help at startup.
When following a trace, use its semantic targets and values in order, not its old
refs. Stop at the requested goal; a trace grants no additional authorization.
<id>--session <id>session stopbsk --helpbsk <command...> --help-
根据用户请求定义成功标准。运行并保留其
bsk session start --json。多浏览器时,运行session_id并添加bsk browsers来启动。后台工作时,仅在--browser <id-or-label>中添加session start。--no-focus -
对于新页面,直接导航;对于现有用户标签页,遵循下方借用部分。交互前先阅读页面:sh
bsk navigate https://example.com --session <id> bsk observe --session <id> -
使用该次观察中的新引用选择一个动作。导航或有意义的DOM变更后再次观察。对模糊结果检查一次;一旦成功可见,停止操作,不要刷新或再次检查。
-
成功和失败时均运行`bsk session stop <id>,除非用户要求保持会话打开。这也会归还借用的标签页。归还的标签页仍会在用户窗口中保持打开。不要依赖空闲清理或停止/重启共享守护进程来完成任务。
用实际结果和任务输入替换、示例引用和值。每个会话作用域命令都需要;按位置接受ID。对于不熟悉的命令或标志,查阅或,不要猜测;无需在启动时阅读所有帮助。遵循跟踪时,按顺序使用其语义目标和值,而不是旧的引用。在请求的目标处停止;跟踪不授予额外授权。
<id>--session <id>session stopbsk --helpbsk <command...> --helpRead and interact
读取和交互
Prefer for text, controls and refs. Navigation invalidates refs;
large DOM changes can stale them too. Re-observe before the next interaction.
Use refs for iframe/shadow-root targets; CSS selectors search the main document.
observe@eNChoose the relevant example, using a ref that actually appeared on the page:
| Need | Command |
|---|---|
| Click | |
| Fill a field | |
| Select an option | |
| Press a key | |
| Reveal a hover menu | |
| Reveal an element | |
| Scroll with wheel input | |
| Focus or leave a field | |
- uses the option's value, not its visible label.
select - Hover markers such as ,
[hover first: Shoes | Bags], or[has-submenu]identify triggers. Hover the trigger, observe, then use the revealed item's ref. Listed labels are not refs; do not click the trigger unless its own action is wanted. If an expected control is missing and no marker identifies a trigger, try[expanded]once. It touches the live page and costs seconds; use targeted hover once the trigger is known.observe --probe-hover - returns ancestor-clipped bounds in top-level viewport CSS pixels. Partial visibility suffices; hidden/fully clipped targets fail. It does not test occlusion.
scroll-tosends signed deltas (at least one nonzero), not a guaranteed scroll distance. An optional target is scrolled into view first; without one, input lands at the viewport centre. Observe to check the page's response.wheel
Use for a static accessibility tree, for exact markup or
hidden metadata, and for visual content or requested visual evidence.
Do not start with HTML/images just to find ordinary controls; obtain fresh refs
before interacting with controls found that way.
snapshotget-htmlscreenshot优先使用获取文本、控件和引用。导航会使引用失效;大的DOM变更也可能使引用过期。下次交互前重新观察。对iframe/shadow-root目标使用引用;CSS选择器在main document中搜索。
observe@eN选择相关示例,使用页面上实际出现的引用:
| 需求 | 命令 |
|---|---|
| 点击 | |
| 填写字段 | |
| 选择选项 | |
| 按键 | |
| 显示悬停菜单 | |
| 显示元素 | |
| 滚轮滚动 | |
| 聚焦或离开字段 | |
- 使用选项的值,而不是其可见标签。
select - 悬停标记如、
[hover first: Shoes | Bags]或[has-submenu]标识触发器。悬停触发器,观察,然后使用显示出的项目的引用。列出的标签不是引用;除非需要其自身操作,否则不要点击触发器。如果预期控件缺失且没有标记标识触发器,尝试一次[expanded]。它会触及活动页面并耗费数秒;一旦知道触发器,就使用有针对性的悬停。observe --probe-hover - 返回顶层视口CSS像素中由祖先裁剪的边界。部分可见即可;隐藏/完全裁剪的目标失败。它不测试遮挡。
scroll-to发送有符号增量(至少一个非零),不保证滚动距离。可选目标会先滚动到视图中;没有目标时,输入落在视口中心。观察以检查页面响应。wheel
使用获取静态可访问性树,获取精确标记或隐藏元数据,获取视觉内容或请求的视觉证据。不要一开始就使用HTML/图像来寻找普通控件;以这种方式找到控件后,在交互前获取新引用。
snapshotget-htmlscreenshotLarge observations
大型观察
There is no default token cap. With , follow a returned
/ when relevant content remains:
observe --max-tokens <n>next_cursor@moresh
bsk observe --cursor <token> --session <id>Each page replaces the ref map: use its refs before continuing and never reuse
refs from earlier pages. Continuation reads the same capture, without refreshing
or hovering; do not combine it with depth changes or hover probing. New observe/
snapshot or changed page identity invalidates continuation; then observe afresh.
没有默认token上限。使用时,在相关内容剩余时跟随返回的/:
observe --max-tokens <n>next_cursor@moresh
bsk observe --cursor <token> --session <id>每个页面替换引用映射:在继续前使用其引用,绝不重用之前页面的引用。继续读取同一捕获内容,不刷新或悬停;不要将其与深度变化或悬停探测结合。新的observe/snapshot或页面身份变化会使继续无效;然后重新观察。
Borrowing and browser settings
借用和浏览器设置
List before borrowing, and return the tab as soon as the relevant step ends:
sh
bsk tab list --scope user --session <id>
bsk tab borrow <tab-id> --session <id>
bsk tab return <tab-id> --session <id>Never invent tab IDs or keep a user tab across unrelated work. Do not repeat
pending, denied or timed-out borrows. For , inspect tab/
session state first: the tab may already have moved. Do not bypass an outcome
through another browser backend. changes only the
confirmation wait (default 60s); custom waits require daemon and extension protocol 1.2+.
borrow_outcome_unknowntab borrow --timeout 120sThe extension's saved Automation settings control borrow confirmation and human
help independently; both default on and apply to existing sessions too. Read
in or when needed.
Deprecated , , and cannot override
these settings. Never change browser storage/settings to bypass them. Human-help
availability does not require permission for every action or grant extra authority.
requires daemon protocol 1.3; update CLI, daemon and extension for
full settings support. A feature's version error does not disable other operations.
interactionsession start --jsonsession list --json--unattended--no-confirmBSK_REQUEST_HELP=offrequest-helpRemote content reads/actions require task-created or borrowed tabs. Page-opened
popups gain no control automatically; an unowned tab inside the Agent Window
needs the user to move it to a user window before borrowing. Remote upload/download
are unsupported; screenshots work.
借用前列出,并在相关步骤结束后尽快归还标签页:
sh
bsk tab list --scope user --session <id>
bsk tab borrow <tab-id> --session <id>
bsk tab return <tab-id> --session <id>绝不虚构标签页ID,也不要在无关工作中保留用户标签页。不要重复待处理、被拒绝或超时的借用。对于,首先检查标签页/会话状态:标签页可能已经移动。不要通过另一个浏览器后端绕过结果。仅更改确认等待时间(默认60秒);自定义等待需要守护进程和扩展协议1.2+。
borrow_outcome_unknowntab borrow --timeout 120s扩展保存的Automation设置独立控制借用确认和人工帮助;两者默认开启并适用于现有会话。需要时读取或中的。已弃用的、和不能覆盖这些设置。绝不更改浏览器存储/设置来绕过它们。人工帮助可用性不需要每次操作都获得许可,也不授予额外权限。需要守护进程协议1.3;更新CLI、守护进程和扩展以获得完整设置支持。功能的版本错误不会禁用其他操作。
session start --jsonsession list --jsoninteraction--unattended--no-confirmBSK_REQUEST_HELP=offrequest-help远程内容读取/操作需要任务创建或借用的标签页。页面打开的弹出窗口不会自动获得控制权;Agent Window中未拥有的标签页需要用户先将其移到用户窗口才能借用。远程上传/下载不支持;截图可行。
Human steps and recovery
人工步骤和恢复
With help enabled, request help for login, CAPTCHA, OTP, payment confirmation,
consent, or after two attempts make no progress:
sh
bsk request-help --session <id> --prompt "Please complete sign-in" --target @e3Use a precise prompt and fresh targets; omit when no control fits.
Use completion criteria only for a clear, stable success signal.
--target| Result | Next step |
|---|---|
Help | Observe again, then resume with fresh refs. |
Help | Respect rejection or the blocker; do not repeat the request. |
Help | No human action was confirmed. Re-observe and follow the disabled-help rules below. |
| Stale ref | Observe and retry the intended action once. |
| Unknown tab/session | List current tabs/sessions; never guess IDs or use another task's session. |
| Timeout or unknown effect | Inspect current state before retrying; the action may already have happened. |
| Read the field: formatting may still satisfy the request. Correct only a remaining difference; no blind refill or immediate handoff. |
| Unsupported operation | Use available capabilities; suggest updating only if the missing feature is needed. |
Navigation alone (including deprecated help outcome ) is not completion.
For other errors, follow the returned hint and inspect the current state.
navigatedHelp disabled: do not request help or re-enable it. Use existing login state,
authorized inputs and viable alternatives; disabling help adds no permission and
does not remove borrow confirmation or host restrictions. Where authorized, a
vision-capable model may attempt graphical verification. Phone-only QR scans,
face verification, missing SMS codes or image-only tasks for a text-only model
may remain blocked. Report a specific blocker only when inputs/capabilities are
missing or viable approaches are exhausted; continue independent work. Do not loop
on identical failures, repeat unknown effects or switch backends to bypass limits.
On an unrecoverable failure, report the blocker and stop the owned session.
启用帮助后,对于登录、CAPTCHA、OTP、支付确认、同意,或两次尝试无进展时,请求帮助:
sh
bsk request-help --session <id> --prompt "Please complete sign-in" --target @e3使用精确的提示和新的目标;没有合适的控件时省略。仅对清晰、稳定的成功信号使用完成标准。
--target| 结果 | 下一步 |
|---|---|
帮助 | 再次观察,然后用新引用继续。 |
帮助 | 尊重拒绝或障碍;不要重复请求。 |
帮助 | 未确认人工操作。重新观察并遵循下方的禁用帮助规则。 |
| 引用过期 | 观察并重试预期操作一次。 |
| 未知标签页/会话 | 列出当前标签页/会话;绝不猜测ID或使用其他任务的会话。 |
| 超时或未知效果 | 重试前检查当前状态;操作可能已发生。 |
| 读取字段:格式可能已满足要求。仅纠正剩余差异;不要盲目重新填充或立即移交。 |
| 不支持的操作 | 使用现有功能;仅在缺少的功能需要时建议更新。 |
仅导航(包括已弃用的帮助结果)不算完成。对于其他错误,遵循返回的提示并检查当前状态。
navigated**禁用帮助:**不要请求帮助或重新启用它。使用现有登录状态、授权输入和可行的替代方案;禁用帮助不增加权限,也不移除借用确认或主机限制。在授权范围内,具备视觉能力的模型可尝试图形验证。仅限手机QR扫描、面部验证、缺失短信验证码或纯图像任务,对于仅文本模型可能会保持阻塞。仅在输入/能力缺失或可行方法已用尽时报告具体阻塞;继续独立工作。不要在相同失败上循环、重复未知效果或切换后端以绕过限制。遇到不可恢复的失败时,报告阻塞并停止拥有的会话。
Screenshots and Canvas
截图和Canvas
sh
bsk screenshot --session <id> --out viewport.png
bsk screenshot --session <id> --ref @e3 --out element.png --json
bsk screenshot --session <id> --full-page --out page.png
bsk screenshot --session <id> --full-page --scope current --out loaded.pngScreenshots return a local PNG path; view the image to interpret it.
replaces an existing file; omitting it uses a temporary path. includes
dimensions and byte size. and cannot be combined.
--out--json--ref--full-pageFull-page mode scrolls an ordinary webpage and restores its position/styles.
The default follows appended content. Use when
capturing the currently loaded range is requested: it stops at the initial document
height, even if a loading indicator remains. Later content below that boundary is
excluded; report this range rather than claiming all feed entries were loaded.
Use a selected, session-controlled tab and stable viewport; targets a
tab without selecting it. Internal browser pages, the Web Store, nested scrolling
panels and virtualized lists are unsupported. Capture/encoding defaults to 2m;
extends it only in full-page mode. Allow the shell enough time for
capture plus transfer. Respect cancellation; do not blindly retry endless pages
or substitute a viewport image when an older extension rejects full-page capture.
Use matching CLI/extension builds. Ctrl-C cancels; failed full-page captures save
no partial image. A error means the bottom kept a loading
indicator without height growth for 30s; do not simply increase the deadline.
Choose only when that range satisfies the request. Keep the capture tab
visible: is an environment interruption, while
means user input stopped capture. For other failures follow the returned reason
and hint; do not work around them by editing the page or stitching screenshots.
--scope follow--scope current--tab-id--timeout 5mloading_stalledcurrentpage_hiddenuser_cancelledFor , observe returns text, not pixels. Screenshot
that ref when its contents matter; never infer Canvas controls or names from
nearby labels. If images cannot be received/understood, explain the limitation,
ask for an image-capable model when needed, and continue with available semantics.
@eN canvas [visual:screenshot]To click a point seen in a Canvas image, retain that screenshot's :
capture_idsh
bsk click @e3 --capture <capture-id> --image-x <x> --image-y <y> --session <id>Use ORIGINAL PNG coordinates and dimensions, not resized display/viewport pixels.
Captures are single-use, expire after 2m, and are invalidated by ref replacement
(observe/snapshot/continuation) or a newer screenshot of that ref. With
, the image is view-only: observe and screenshot again before
clicking. Counts 1/2, buttons and modifiers work; Canvas fill, IME, drag, hover
and HTML extraction do not. Repainting is allowed; changed identity/geometry/hit
targets are rejected. Verify the result, using DOM refs for revealed controls;
inspect before retrying with a new capture.
capture_unavailableeffect_state=unknownsh
bsk screenshot --session <id> --out viewport.png
bsk screenshot --session <id> --ref @e3 --out element.png --json
bsk screenshot --session <id> --full-page --out page.png
bsk screenshot --session <id> --full-page --scope current --out loaded.png截图返回本地PNG路径;查看图像以解读。替换现有文件;省略则使用临时路径。包含尺寸和字节大小。和不能同时使用。
--out--json--ref--full-page整页模式滚动普通网页并恢复其位置/样式。默认跟随追加的内容。当需要捕获当前加载范围时使用:它在初始文档高度处停止,即使加载指示器仍在。该边界下方的后续内容被排除;报告此范围,而不是声称所有feed条目已加载。使用选定且会话控制的标签页和稳定视口;在不选择标签页的情况下定位。内部浏览器页面、Web Store、嵌套滚动面板和虚拟化列表不受支持。捕获/编码默认2分钟;仅在整页模式下扩展它。给shell足够的时间进行捕获和传输。尊重取消;不要盲目重试无尽页面或在旧扩展拒绝整页捕获时用视口图像替代。使用匹配的CLI/扩展版本。Ctrl-C取消;失败的整页捕获不保存部分图像。错误表示底部在30秒内保持加载指示器而高度未增长;不要简单增加截止时间。仅当该范围满足请求时才选择。保持捕获标签页可见:是环境中断,而表示用户输入停止捕获。对于其他失败,遵循返回的原因和提示;不要通过编辑页面或拼接截图来绕过。
--scope follow--scope current--tab-id--timeout 5mloading_stalledcurrentpage_hiddenuser_cancelled对于,observe返回文本而非像素。当其内容重要时截图该引用;绝不要从附近标签推断Canvas控件或名称。如果无法接收/理解图像,解释限制,需要时请求图像能力模型,并继续使用可用语义。
@eN canvas [visual:screenshot]要点击Canvas图像中看到的点,保留该截图的:
capture_idsh
bsk click @e3 --capture <capture-id> --image-x <x> --image-y <y> --session <id>使用原始PNG坐标和尺寸,而不是调整大小的显示/视口像素。捕获为一次性,2分钟后过期,并因引用替换(observe/snapshot/继续)或该引用的新截图而失效。遇到时,图像仅可查看:再次观察并截图后再点击。计数1/2、按钮和修饰键可用;Canvas填充、IME、拖拽、悬停和HTML提取不可用。允许重绘;拒绝更改的身份/几何/命中目标。验证结果,使用DOM引用获取显示的控件;重试新捕获前检查。
capture_unavailableeffect_state=unknownFiles and other tools
文件和其他工具
sh
bsk upload @e3 --file ./report.pdf --session <id>
bsk download @e3 --out ./report.pdf --session <id>Upload discloses the file to the site; download accepts site-controlled bytes.
Use agent-local paths, not browser-internal staging paths.
- Default upload clicks an upload button/label and intercepts its file chooser.
- If and
reason=file_input_not_activated, re-observe. Tryeffect_state=noneonce only on a clear attachment target such as a drop zone or composer, never whitespace or an ambiguous container. Otherwise follow the human-help rules. There is no automatic fallback between mechanisms.--mode drop - Never retry or switch upload modes for or
effect_state=unknown. A successful drop proves dispatch, not site acceptance; observe the attachment.committed - Download refuses overwrite by default; add only when replacement is intended. Consult each command's help for other flags.
--overwrite
Use / for bounded read-only diagnostics; follow returned
sequence cursors. affects one tab; restores it.
is a last resort: inspect JSON , since a script exception can have
CLI exit code 0. Never evaluate secrets. captures user actions;
read its help first and never record banking, SSO or password-manager pages.
Use to find navigation/history, tab, wait and window commands.
consolenetworkemulate --device iphone-14--offevaluate.okrecord startbsk --helpsh
bsk upload @e3 --file ./report.pdf --session <id>
bsk download @e3 --out ./report.pdf --session <id>上传将文件披露给站点;下载接受站点控制的字节。使用代理本地路径,而不是浏览器内部暂存路径。
- 默认上传会点击上传按钮/标签并拦截其文件选择器。
- 如果且
reason=file_input_not_activated,重新观察。仅在明确的附件目标(如拖放区或编辑器)上尝试一次effect_state=none,绝不在空白或模糊容器上。否则遵循人工帮助规则。机制之间没有自动回退。--mode drop - 对于或
effect_state=unknown绝不重试或切换上传模式。成功的drop证明分发,而非站点接受;观察附件。committed - 下载默认拒绝覆盖;仅在打算替换时添加。有关其他标志,请查阅每个命令的帮助。
--overwrite
使用/进行有界只读诊断;遵循返回的序列游标。影响一个标签页;恢复。是最后手段:检查JSON ,因为脚本异常可能CLI退出码为0。绝不evaluate秘密。捕获用户操作;先阅读其帮助,绝不录制银行、SSO或密码管理器页面。使用查找导航/历史、标签页、等待和窗口命令。
consolenetworkemulate --device iphone-14--offevaluate.okrecord startbsk --help