DeepSeek Harness 插件

BeiningCheng/dsh-plugin-browser-bridge

Star 数 ★ 0 下载量(近 30 天) 579 分类 浏览器与网页 收录于 2026-11-27 npm dsh-plugin-browser-bridge

让 DSH 直接读 Chrome 页面:通过令牌配对的扩展在本地回环 WebSocket 上提供 8 个 browser_* 工具,按选择器或文本读元素、点击、填表、跳转,不截图,也不打开 DevTools 端口。

安装

# npm 包(预构建)

dsh plugin --profile web add dsh-plugin-browser-bridge

# GitHub 源码(首次需按提示配置 allowBuilds 构建授权后重试)

dsh plugin --profile web add github:BeiningCheng/dsh-plugin-browser-bridge

装任何插件都等于在你的机器上跑第三方代码,权限和你本人一样大——能读你的文件、用你的凭据、访问网络,工具审批管不到它。GitHub 来源的插件还会在安装时执行构建脚本——pnpm 默认拦截,所以安装可能停在 ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED 或 ERR_PNPM_IGNORED_BUILDS;dsh 会打印出需要添加的确切键名,把它加进该 profile 的 pnpm-workspace.yaml 的 allowBuilds 下,重跑一次即可装上。放行构建本身就是一次信任判断:请只安装可信来源,并尽量锁定 commit(github:owner/repo#sha)。

README

该插件的 README 只有英文版本。

Let DeepSeek Harness read a Chrome page as data and click the right element — instead of taking a screenshot and guessing coordinates.

The plugin registers eight browser_* tools and listens on one loopback WebSocket (ws://127.0.0.1:17871/ws). The bundled Chrome extension dials in with a pairing token, then executes a fixed command list inside the page with chrome.scripting. Nothing is exposed on the network and no remote-debugging port is opened.

Tool What it does
browser_status Connection state, port, token path, frame counters
browser_tabs List open tabs (id, title, url, active)
browser_read Page text / HTML / links, optionally scoped to one CSS selector
browser_query Elements matching a selector: text, tag, href, form value, on-screen rect
browser_click Click by CSS selector, by exact or partial text, or by viewport point
browser_type Type into a field (input/change events, so React/Vue state updates) with optional Enter
browser_navigate Open a URL in a tab, keeping the user's cookies and logins
browser_screenshot Capture the tab viewport as a downscaled image (no desktop capture, no permission dialog)

What it looks like

A DeepSeek Harness tab captured through the extension

That frame came back from browser_screenshot on a normal Chrome tab: no desktop capture, no screen sharing prompt, just chrome.tabs.captureVisibleTab in the extension, downscaled to 1600 px wide before it crosses the WebSocket.

Reading is the cheap part, though. One browser_query on a video site returns structured rows instead of pixels:

{ "count": 8, "rows": [
  { "text": "一个“国误奇观”的故事", "tag": "h3", "href": "https://www.bilibili.com/video/BV1h9n96tEna",
    "rect": { "x": 96, "y": 412, "width": 380, "height": 48 }, "visible": true }
] }

So the model can click that exact element by selector instead of estimating a coordinate:

browser_click { "text": "一个“国误奇观”的故事" }
→ { "clicked": true, "target": { "tag": "a", "href": "https://www.bilibili.com/video/BV1h9n96tEna?…" } }

Capturing needs the Chrome window to be visible (a minimized or fully covered window makes captureVisibleTab wait); reading, querying, clicking and typing work regardless.

Install

dsh plugin --profile web add dsh-plugin-browser-bridge

Then open the plugin panel and enable Browser Bridge — it is off by default, because it hands a page-driving capability to the model.

Pair the extension

  1. Run browser_status once; the plugin creates ~/.config/dsh-browser-bridge/token (mode 0600).
  2. In Chrome open chrome://extensions, turn on Developer mode, click Load unpacked, and pick the extension/ directory inside this package.
  3. Open the extension's Options, paste the token, click Save and reconnect.

~/.config/dsh-browser-bridge/pair-allow can be used to let the extension fetch the token itself from GET /pair (the marker is deleted immediately); without it that endpoint answers 426.

Why a paired extension instead of --remote-debugging-port

While the DevTools port is open, any process on the machine can drive the browser and read every logged-in session. Here the only listener is a token-guarded loopback socket, and the extension implements a closed command list — it cannot be asked to run arbitrary CDP calls.

Notes

  • chrome:// pages, the Web Store and other extensions' pages cannot be scripted; use browser_screenshot there (the tab must be visible in a non-minimized window).
  • Manifest V3 suspends an idle service worker after ~30s, so the extension sends a ping every 20s and the host pings back. After editing extension/, reload it with the ↻ button on chrome://extensions.
  • Full design notes and troubleshooting: docs/DETAIL.md.

中文简介

浏览器桥给 DSH 装上「读页面」的能力:不截图、不猜坐标,直接按 CSS 选择器或文本读取元素、 点击、填表、跳转,并在需要时返回一张缩小的视口截图。它由 DSH 侧插件(8 个 browser_* 工具 + 本地 WebSocket)和 Chrome 侧扩展(受限指令集)组成,默认关闭,需要在插件面板里手动启用。

License

MIT

内容来自项目 README(GitHub)↗

链接

同类插件

查看整个分类 →

社区评论

评论公开保存在 GitHub Discussions。加载评论会连接 GitHub 和 Giscus;发表内容需要 GitHub 账号。