SuperAPI AI 工具集

electron

通用与其它

查看项目

更新于 10-16 09:29

技能介绍

用途:该技能用于自动化基于 Electron 构建的桌面应用。由于 Electron 应用基于 Chromium,会开放 Chrome DevTools Protocol(CDP)端口,agent-browser 可连接该端口,复用网页的 snapshot-interact 工作流。

主要能力:启动应用时开启远程调试端口并连接;用快照发现可交互元素,通过元素引用(如 @e5)点击、填表、按键、读取文本;截图(含整页和标注);列出并切换窗口或 webview;以命名的 session 同时控制多个应用;通过 --color-scheme dark 保留深色模式。

必要用法:先用 --remote-debugging-port 启动应用,例如 macOS 执行 open -a "Slack" --args --remote-debugging-port=9222,Linux 执行 slack --remote-debugging-port=9222,Windows 指定 exe 路径加同样参数;若应用已在运行需先退出再带参数重启。随后执行 agent-browser connect 9222,再运行 agent-browser snapshot -i、agent-browser click @e5、agent-browser screenshot slack-desktop.png。也可用 --cdp 或 --auto-connect;切换目标用 agent-browser tab。

适用场景:支持任何 Electron 应用,资料举例包括 Slack、Discord、Teams、Signal、Telegram Desktop、VS Code、GitHub Desktop、Postman、Insomnia、Figma、Notion、Obsidian、Spotify、Tidal、Todoist、Linear、1Password。

限制:必须带调试端口启动,连接失败需检查端口占用与初始化等待时间;元素缺失可能因多 webview 需切换目标;输入异常可尝试 keyboard type 或 keyboard inserttext 绕过按键事件。webview 支持依赖原始 CDP 连接。其余未在资料中说明的细节暂未提供。