- Главная
- Плагины
- Инструменты и функции
- dsh-browser-bridge
dsh-browser-bridge
robin-soulmate/dsh-browser-bridge
Drives the Chrome, Edge or QQ browser you are already using through a loopback WebSocket bridge and a hand-loaded MV3 extension - one browser tool snapshots a page into e1/e2 element refs, then clicks, fills, types, presses keys, scrolls, waits and captures screenshots on your real logged-in tabs, with a pairing code, a read-only mode, a site blocklist and three emergency stops. Its HTTP routes have no DSH access check, so a web page open in your browser could call them.
Установка
dsh plugin --profile web add github:robin-soulmate/dsh-browser-bridgeREADME
DSH 浏览器操控(Browser Bridge)
让 DSH 在本机接管 Chromium 浏览器(Chrome / Edge / QQ 浏览器):打开页面、读取内容、点击、输入、截图。
全程只走 127.0.0.1,不经过任何云端;不申请 debugger 权限。
English: a DSH plugin that drives the Chrome / Edge / QQ browser you are already using — a loopback WebSocket bridge plus a hand-loaded MV3 extension, so the agent works on your real logged-in tabs without moving the system mouse or keyboard.
组成
| 部分 | 作用 |
|---|---|
| DSH 插件(本包) | 在本机起 WebSocket 服务(48620–48630)、注册 browser 工具、提供设置页 UI |
浏览器扩展 extension/ | MV3 扩展:把 chrome.tabs / 页面脚本能力暴露给桌面端 |
安装
# 从 npm 装(推荐,带版本号)
dsh plugin --profile web add npm:@robinlover/dsh-browser-bridge
# 或直接从源码装
dsh plugin --profile web add github:Robin-soulmate/dsh-browser-bridge
装好后 DSH 设置里会多出「浏览器操控」一页,接着按下面的「安装扩展」把 extension/ 目录加载进浏览器,
再把设置页显示的 6 位配对码填进扩展弹窗即可。
数据与端口
- 数据目录:
%LOCALAPPDATA%\DSH\browser-bridge(state.json、audit.log、screenshots/) - 端口文件:
%LOCALAPPDATA%\DSH\bridge.json→{port, pid, startedAt, version} - 端口:
48620起,占用则顺延到48630 GET /health:{ok:true, pid, port, version, startedAt}- 桥自带控制面(只绑
127.0.0.1):GET /state、POST /pair|/config|/revoke|/forget—— POST 需带自定义头x-dbb-control: 1(网页无法免预检携带,挡跨站伪造) - 设置页走 DSH webServer 上的同源路由:
/browser-bridge/state|config|pair|revoke|forget|log
协议
信封 {"v":1,"id":"r-17","method":"page.click","params":{...}},响应 {"ok":true,"result":{...}}
或 {"ok":false,"error":{"code":"REF_NOT_FOUND","message":"..."}};事件 {"event":"tabs.updated","data":{...}}。
方法:tabs.list/create/close/activate/attach/detach、page.snapshot/text/html/screenshot/waitFor、
page.click/fill/type/press/hover/scroll/select、page.navigate/reload/back/forward、ping。
工具
模型侧只有一个工具 browser,action 取值:status pair tabs open attach detach close activate snapshot click fill type press scroll wait screenshot navigate back forward reload evaluate stop。
安装扩展
- DSH 设置 → 浏览器操控 → 复制扩展目录
- 浏览器打开
chrome://extensions(Edge 为edge://extensions),打开「开发者模式」 - 点「加载已解压的扩展程序」,选择上一步的目录
- 点扩展弹窗,输入 DSH 里显示的 6 位配对码
安全
- 32 字节随机 token + 6 位一次性配对码(5 分钟有效),错 6 次/分钟限流
- 只监听
127.0.0.1,同源校验所有 HTTP 管理接口 - 站点黑名单:
chrome://、edge://、about:、file:、银行/支付域名、本地管理后台 page.evaluate默认关闭- 三处停止入口:设置页总开关、扩展弹窗「紧急停止」、快捷键
Ctrl+Shift+. - 审计环形缓冲 200 条,落盘
audit.log
和常见桥接做法不同的地方
同类插件往往把 WebSocket 直接挂在 DSH 自己的 Web 端口上、也不做鉴权:本机任何程序连上就能冒充浏览器, 给模型喂任意页面内容;一旦把 DSH 的 Web 端口通过隧道暴露出去,这个口子会跟着一起暴露。本插件的取舍是:
- 单独开 loopback 端口(
127.0.0.1:48620-48630),DSH 端口上只留只读的/browser-bridge/state - 配对码换 token 才能收发指令,错码限流,可一键解除配对
- 一次性 ref:快照给元素打
data-dsh-ref,下一页快照即失效,避免模型拿旧引用点到别处; 点击前还会做elementFromPoint命中检测,被遮挡时报NOT_HITTABLE而不是硬点 - 「只看不点」模式:关掉「允许执行点击与输入」后只剩读页面 / 截图 / 等待
- 站点黑名单:银行、支付、
chrome://、file:、本机管理后台一律BLOCKED_SITE
测试
node tests/protocol.test.mjs # 30 项协议测试(假扩展,含配对码/黑名单/只读放行/移除安装记录)
node tests/e2e.edge.mjs # 16 项真实 Edge 端到端(自建桥:配对→快照→填表→点击→截图)
node tests/pair-edge.mjs --port N # 连正在运行的宿主桥,真实 Edge 配对自测(改用 DSH 里正在跑的桥)
弹窗 UI 可以脱离浏览器预览:
.tmp/preview-server.mjs起静态服务后,用http://127.0.0.1:48800/popup.html?state=connected|paused|disconnected截图,mock-chrome.js会顶替chrome.*API。
Похожие плагины
archify (deepseek-harness)
tt-a1i/archify
WeKnora (dsh-weknora)
tencent/weknora
next-ai-draw-io (dsh-plugin)
dayuanjiang/next-ai-draw-io
AiToEarn (dsh-plugin-aitoearn)
yikart/aitoearn