📦 Clawbrowser — 浏览器
v0.1.1Clawbrowser 浏览器工具,支持网页浏览和自动化。
7· 4.1k·10 当前·13 累计
安全扫描
OpenClaw
安全
medium confidenceThe skill is internally coherent with its stated purpose (driving Playwright via the CLI) but the runtime instructions enable powerful browser-level access (clipboard, page JS, persisted sessions) and reference an environment variable not declared in the metadata — these are legitimate for the task but worth user caution.
安全有层次,运行前请审查代码。
运行时依赖
无特殊依赖
版本
latestv0.1.12026/2/1
- Added ClawAudit AI security badges to the documentation for vulnerability awareness. - No changes to functionality or usage instructions; documentation update only.
● 可疑
安装命令
点击复制官方npx clawhub@latest install clawbrowser
🇨🇳 镜像加速npx clawhub@latest install clawbrowser --registry https://cn.longxiaskill.com
技能文档
 
Setup & orientation
- Install CLI 和 验证 availability:
npm install -g @playwright/cli@latest
playwright-cli --help
The CLI is headless by default; add --headed to open or set browser.launchOptions.headless to false in playwright-cli.json when you need to see the UI.
- CLI reads
playwright-cli.json由 默认 或 whatever file 您 pass 带有--配置. 使用 配置 到 tune browser name, launch/context options, viewport, timeouts, 输出 directories, 和 recording settings 没有 changing every command. - Keep
playwright-cli --helpterminal-accessible; script self-documents latest commands 和 options 所以 您 可以 刷新 memory 之前 trying 新的 action.
Core interaction 循环
- 开始 带有
playwright-cli 打开到 加载 page (添加--会话=name如果 您 want isolation up front). - Run
playwright-cli snapshot到 generate 元素 refs (e1,e2, …) 之前 任何 interaction. Always re-snapshot 之后 DOM changes 或 导航 到 avoid stale refs. - 使用 refs 对于 actions:
click, dblclick, hover, drag, check, uncheck, select, fill, 类型, 上传, eval
- Append [按钮], [值], 或 JS snippets 作为 needed (e.g., playwright-cli click e4 right).
- Capture 输出 evidence 带有
screenshot [ref],pdf,console [level], 或network到 prove flow 或 inspect errors. - 示例 flow:
playwright-cli open https://example.com/login
playwright-cli snapshot
playwright-cli fill e1 "user@example.com"
playwright-cli fill e2 "supersecret"
playwright-cli click e3
playwright-cli snapshot
playwright-cli screenshot
Sessions & persistence
- 使用
--会话=到 keep cookies, storage, 和 tabs isolated per workflow. Sessions behave 点赞 persistent profiles: 它们 remember auth state, history, 和 tabs 之间 commands. - 导出
PLAYWRIGHT_CLI_SESSION=mysession如果 您 running many commands 在...中 相同 会话 — CLI 将 默认 到 会话 没有 needing--会话每个 时间. - Manage sessions explicitly:
playwright-cli session-list
playwright-cli session-stop
playwright-cli session-stop-all
playwright-cli session-restart
playwright-cli session-delete
- 使用
playwright-cli --isolated 打开 ...对于 ephemeral contexts 做 不 persist 到 disk. - Whenever 您 更改 browser settings 对于 会话 (launch args, headless 切换, browser selection), rerun
playwright-cli 配置对于 会话 和 然后会话-restart到 apply 新的 配置.
Tabs, 导航, 和 devtools
- 标签页 helpers:
标签页-列表,标签页-新的 [url],标签页-关闭 <索引>,标签页-select <索引>. - 导航 shortcuts:
go-back,go-转发,重新加载. - Keyboard 和 mouse control:
press <键>,keydown,keyup,mousemove,mousedown [按钮],mouseup [按钮],mousewheel. - Devtools-样式 introspection:
playwright-cli console [level]
playwright-cli network
playwright-cli run-code "async page => await page.context().grantPermissions(['clipboard-read'])"
Use these to check console logs, inspect network requests, or inject helper scripts.Recording, tracing, 和 exports
- 记录 traces 和 videos 周围 delicate interactions 所以 您 可以 replay 什么 agent 做过 later:
playwright-cli tracing-start
# perform steps
playwright-cli tracing-stop
playwright-cli video-start
# perform steps
playwright-cli video-stop video.webm
- 保存 evidence 到 disk 带有
screenshot,pdf, 或snapshot(哪个 dumps 元素 refs). Recorded files honoroutputDir从 配置.
配置, state, 和 housekeeping
- 使用
playwright-cli 配置到 tweak runtime flags 没有 reinstalling. Examples:
playwright-cli config --headed --browser=firefox
playwright-cli --session=auth config --config=playwright-cli.json
Change browser, contextOptions, launchOptions, or recording settings in the config and restart the session to apply them.
- Running
playwright-cli installrefreshes browser binaries 如果 environment 新的 或 您 接收 errors 关于 missing binaries. - Clean up sessions 当...时 finished 到 avoid stale state:
playwright-cli session-stop
playwright-cli session-delete
Troubleshooting & reminders
- 如果 command fails, rerun
playwright-cli snapshot到 confirm refs 仍然 有效. Snapshots provide current DOM context 对于click/类型operations. playwright-cli --helpalways shows latest command 设置, 所以 consult 之前 trying rarely used 标志.- 当...时 agent needs 到 replicate recorded manual flow, capture screenshot, note 会话 name, 和 mention 哪个 refs 和 tabs 是 在...中 使用.
- 如果 targeting visible browser 必填 (e.g., manual inspection), reconfigure 带有
--headed, 或 runplaywright-cli 打开 --headed对于 会话 仅.
数据来源:ClawHub ↗ · 中文优化:龙虾技能库