Install
openclaw skills install windows-browser-opsWindows Desktop 浏览器远程操控。用于在 Discord / 本地会话中触发 Edge/Chrome 执行“打开网页、交互、截图、打包下载”等动作,并回传证据。
openclaw skills install windows-browser-opsopenclaw devices approve 并可通过 tools.exec node=Desktop 执行命令。skills/windows-browser-ops/scripts/)。| 需求 | 步骤 |
|---|---|
| 打开网页 + 截图 | 1) launch_edge.ps1 -Url <网址> 2) focus_edge.ps1 3) capture_screenshot.ps1 -Output <路径> 4) 把截图上传给少爷 |
| 下载文件并打包 | 1) 导航并执行下载 2) 等待 .crdownload 消失 3) download_and_zip.ps1 -SourcePath "C:\\Users\\<USER>\\Downloads" -ZipPath %TEMP%\\edge-export.zip 4) 上传 ZIP |
launch_edge.ps1,再 focus_edge.ps1。launch_edge.ps1 -Url <初始URL>:若 Edge 未运行则启动(未来可扩展到 Chrome)。focus_edge.ps1:调用 Win32 API 把 Edge 窗口置前。若失败,重启 Edge 并重试。edge_nav.ps1 -Url <目标>:当前版本通过重新打开 Edge 导航,后续可换成 UIAutomation/DevTools。Add-Type -AssemblyName UIAutomationClient 获取控件;参考 references/edge_playbook.md 中的片段。capture_screenshot.ps1 -Output %TEMP%\\edge-shot.png 捕捉全屏。必要时修改脚本以截取指定窗口。Ctrl+P + Enter(后续可通过 SendKeys/AutoHotkey 脚本扩展)。Downloads,等待 .crdownload 文件清空。download_and_zip.ps1 -SourcePath <下载目录> -ZipPath %TEMP%\\edge-export.zip。| 脚本 | 作用 | 备注 |
|---|---|---|
scripts/launch_edge.ps1 | 启动 Edge 并可选导航到 URL | 需改进为检测执行路径 / 支持 Chrome |
scripts/focus_edge.ps1 | 调用 Win32 API 将 Edge 置前 | 后续可加入 ShowWindowAsync |
scripts/edge_nav.ps1 | 导航到目标 URL | 未来替换为 DevTools/automation |
scripts/capture_screenshot.ps1 | 全屏截图 | 当前抓取主屏;多屏需扩展 |
scripts/download_and_zip.ps1 | 打包下载目录 | 记得过滤旧文件 |
Windows 本地实测时,将这些脚本复制到
C:\Users\louis\openclaw-scripts\windows-browser-ops\,并使用 WSL 跨环境调用:/mnt/c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe \ -File C:\Users\louis\openclaw-scripts\windows-browser-ops\edge_nav.ps1 \\ -Url "https://www.microsoft.com" /mnt/c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe \ -File C:\Users\louis\openclaw-scripts\windows-browser-ops\capture_screenshot.ps1 \\ -Output C:\Users\louis\Desktop\edge-shot.png /mnt/c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe \ -File C:\Users\louis\openclaw-scripts\windows-browser-ops\download_and_zip.ps1 \\ -SourcePath C:\Users\louis\Downloads \\ -ZipPath C:\Users\louis\Desktop\edge-downloads.zip
更多细节与扩展想法见 references/api_reference.md 与 references/edge_playbook.md。
Start-Process msedge。tscon 让会话保持前台。Set-ExecutionPolicy RemoteSigned -Scope CurrentUser。