dsh-builtin-browser 0.4.15 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/README.en.md +17 -9
  3. package/README.md +48 -10
  4. package/client.js +410 -6
  5. package/desktop-bridge/install-and-start.cmd +36 -0
  6. package/desktop-bridge/install.mjs +166 -3
  7. package/desktop-bridge/plugin-browser-bridge.js +133 -11
  8. package/docs/development.md +19 -0
  9. package/docs/limitations.md +7 -3
  10. package/docs/user-guide.md +46 -18
  11. package/lib/browser/runtime.d.ts +21 -2
  12. package/lib/browser/runtime.js +30 -0
  13. package/lib/browser/types.d.ts +54 -0
  14. package/lib/browser-electron/bridge-status.d.ts +41 -0
  15. package/lib/browser-electron/bridge-status.js +164 -0
  16. package/lib/browser-electron/desktop-bridge-host.d.ts +15 -2
  17. package/lib/browser-electron/desktop-bridge-host.js +75 -44
  18. package/lib/browser-electron/entry.js +130 -11
  19. package/lib/browser-electron/file-write.d.ts +2 -0
  20. package/lib/browser-electron/file-write.js +39 -0
  21. package/lib/browser-electron/history-store.d.ts +8 -19
  22. package/lib/browser-electron/history-store.js +37 -58
  23. package/lib/browser-electron/host-main.js +15 -22
  24. package/lib/browser-electron/preview-route.d.ts +89 -0
  25. package/lib/browser-electron/preview-route.js +172 -0
  26. package/lib/browser-electron/provider.d.ts +62 -3
  27. package/lib/browser-electron/provider.js +246 -12
  28. package/lib/browser-electron/remote-host.js +5 -1
  29. package/lib/browser-electron/rpc-input.d.ts +4 -0
  30. package/lib/browser-electron/rpc-input.js +11 -0
  31. package/lib/browser-electron/runtime-diagnostics.d.ts +12 -0
  32. package/lib/browser-electron/runtime-diagnostics.js +29 -0
  33. package/lib/browser-electron/settings-store.d.ts +15 -2
  34. package/lib/browser-electron/settings-store.js +25 -5
  35. package/lib/browser-electron/system-browser.d.ts +18 -0
  36. package/lib/browser-electron/system-browser.js +116 -33
  37. package/lib/tool-browser/index.js +10 -1
  38. package/package.json +8 -3
  39. package/scripts/install-electron.mjs +66 -0
  40. package/scripts/verify-preview-route.mjs +150 -0
  41. package/src/browser/runtime.ts +36 -0
  42. package/src/browser/types.ts +55 -0
  43. package/src/browser-electron/bridge-status.ts +180 -0
  44. package/src/browser-electron/desktop-bridge-host.ts +75 -41
  45. package/src/browser-electron/entry.ts +119 -11
  46. package/src/browser-electron/file-write.ts +31 -0
  47. package/src/browser-electron/history-store.ts +36 -57
  48. package/src/browser-electron/host-main.ts +16 -18
  49. package/src/browser-electron/preview-route.ts +222 -0
  50. package/src/browser-electron/provider.ts +286 -16
  51. package/src/browser-electron/remote-host.ts +5 -1
  52. package/src/browser-electron/rpc-input.ts +13 -0
  53. package/src/browser-electron/runtime-diagnostics.ts +38 -0
  54. package/src/browser-electron/settings-store.ts +37 -5
  55. package/src/browser-electron/system-browser.ts +108 -29
  56. package/src/tool-browser/index.ts +13 -1
package/CHANGELOG.md CHANGED
@@ -2,6 +2,48 @@
2
2
 
3
3
  本文件记录各轮功能开发与问题修复(由仓库外独立文档迁入,随仓库管理)。
4
4
 
5
+ ## 0.4.16(本地发布候选,2026-10-31)
6
+
7
+ 本版本正在准备,尚未发布到 npm。建议现有用户在发布后升级;更新步骤与备份范围见[用户指南](docs/user-guide.md#升级到-0416)。
8
+
9
+ - **减少任务串扰**:系统 Chrome/Edge 并发选页按连接排队;桌面 rc.5 侧栏按会话与精确 tab 身份列页和关闭。
10
+ - **保护文件与权限选择**:下载/截图不覆盖既有临时文件或最终文件;bridge 收紧输入和认证边界;设置损坏或无法读取时关闭敏感能力。
11
+ - **恢复更可靠**:修复载体切换与旧连接晚到结果、临时 profile 清理和历史保留规则;bridge 回滚保留升级后的应用归档。
12
+ - **补齐安装体验**:新增本插件的 `postinstall` 与本地命令 `dsh-browser-install-electron`,明确解析已安装 electron 包的 `install.js` 准备二进制,避免 Electron 44 懒下载导致安装成功却没有可启动内核。宿主需允许构建脚本;DSH rc.5 的 pnpm 11.7 `strict-dep-builds` 首次可能需要原生插件管理器批准,不自动修改 `allowBuilds`。遵守 `ELECTRON_SKIP_BINARY_DOWNLOAD`;下载失败保留错误并返回非零退出码。
13
+ - **启动诊断**:自托管启动日志记录可执行文件路径、选择来源及实际 Electron/Chromium/Node 版本;选中低于安全阈值的 44.x 时明确告警,保留显式覆盖的优先级。
14
+ - **关闭连接**:接住 readline 转发的 socket 错误,避免父连接重置误报为全局未捕获异常;仍记录实际传输故障并按原路径退出。
15
+ - **更新依赖**:Electron 声明 `^44.10.0`,锁文件解析到 `44.10.0`,限定在 `44.x`;安全最低阈值为 `44.9.1`。undici override 为 `7.30.1`,CI 使用冻结锁文件。
16
+
17
+ 插件、DSH 外壳、外壳内 bridge 与 `ELECTRON_PATH` 覆盖分别管理。此版本不会自动替换已安装的外壳或 bridge,也未实现内置 Electron 的服务器无显示启动或远程预览。
18
+
19
+ ### 发布准备验证(2026-10-31)
20
+
21
+ - 已使用独立用户数据目录中的真实 Electron `44.10.0` 通过自托管烟测:双任务页面隔离、DOM/无障碍树、输入与点击、JPEG 截图、测试 cookie、带登录态下载及拒绝覆盖、标签操作。
22
+ - 最终源码在冻结锁文件的独立依赖环境中通过构建和完整回归:381 项中 380 通过、1 项 Windows 文件符号链接权限跳过、0 失败;88 项依赖审计各级已知漏洞均为 0。安装准备、运行时版本诊断及真实 TCP FIN/RST 回归包含在内。
23
+ - 这些记录验证自托管链路与测试覆盖的边界,不代表桌面外壳已升级或侧栏端到端通过。生成本地安装包仍不表示已经公开发布。
24
+
25
+ ### 桌面 rc.5 适配(2026-10-31)
26
+
27
+ - 根据已安装 rc.5 的真实 DOM 修复侧栏适配:正确处理 SessionView/SidebarPanel 的嵌套会话标记、手工创建且没有 React fiber 的 webview,收集同会话各 pane 并去重。
28
+ - 以最近 DOM 会话归属和一致的 tab 属性验证身份,优先调用 closeIn 并检查移除结果;缺少归属、身份冲突、跨会话、关闭失败均明确拒绝,现代 DOM 不再回退到过期 React 身份。
29
+ - 适配阶段新增真实结构对应的客户端回归测试;当时 365 项全量测试中 364 通过、1 项 Windows 文件符号链接权限跳过。另以已安装 rc.5 的真实宿主 peer 验证 34 个工具注册和两个假 provider 调用;这不是侧栏端到端验证。
30
+ - 此项源码适配没有替换已安装桌面外壳、部署 bridge 或更新用户级 ELECTRON_PATH。
31
+
32
+ ### 审核缺陷修复(2026-10-30)
33
+
34
+ - 系统浏览器的选页、attach、登记按连接串行执行,阻止不同任务同时认领同一空白页面;attach 失败后允许后续任务重试。
35
+ - 下载和截图通过独占随机临时文件与禁止覆盖的提交保存,不再触碰既有 `.part`,并拒绝覆盖网络等待期间由其他写入者创建的最终文件。
36
+ - 桌面桥拒绝非对象 JSON,限制认证前缓冲和等待时间;侧栏呈现使用真实 guest 数字 id。
37
+ - 侧栏页列表和关闭按请求会话校验面板归属,按精确 tab 身份关闭并确认结果;未知宿主结构或旧客户端缺少能力时明确拒绝。
38
+ - bridge 回滚发现当前 app.asar 时保留当前应用与旧备份,不再删除可能由升级安装的新归档。
39
+ - 从 Chrome/Edge 切回内置或 auto 回退时安装新的自托管载体;取消旧发现任务,阻止旧连接的晚到结果或通知覆盖新选择;卸载正确释放当前载体。
40
+ - 系统浏览器临时 profile 在进程退出后再清理,避免与退出时的写盘冲突。
41
+ - 设置文件访问异常、非法顶层 JSON 关闭能力门控,仅文件不存在使用首次运行默认值。
42
+ - 历史记录收紧限制后立即限制查询,清理不再沿用旧阈值;过期清理独立于数量批处理,保留正常导航的批处理开销。
43
+ - 安装辅助脚本正确解析选项值,所有必要检查先于 pin/peer/备份写入。
44
+ - Electron 审核时将安全最低阈值提高到 44.9.1,发布准备阶段进一步将依赖声明收紧为 `^44.10.0`,锁文件解析到 44.10.0;undici override 更新为 7.30.1。CI 改用冻结的 pnpm 锁文件。
45
+ - 明确 cookies.persist/headless 目前仅控制本机 Chrome/Edge,本轮未添加远程预览或扩展 bundled 无头功能。
46
+
5
47
  ---
6
48
 
7
49
  # 第五十二轮(2026-10-19,两个启动缺陷:hand-off 只认一次、启动参数白送一个空标签)
package/README.en.md CHANGED
@@ -16,9 +16,9 @@
16
16
 
17
17
  `dsh-builtin-browser` gives [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) browser capability:
18
18
 
19
- - **A real page, not a relay**: pages are hosted by a **real browser** — on the desktop that is the official side panel, on `dsh web` it is a window this plugin launches, and you can point it at **your own installed Chrome / Edge** instead. The user watches what the agent is doing and can take over at any time;
19
+ - **A real page, not a relay**: pages are hosted by a **real browser** — the official desktop side panel when the shell and bridge support it, otherwise a window this plugin launches. You can also select **your own installed Chrome / Edge**. The user watches what the agent is doing and can take over at any time;
20
20
  - **Human and agent on the same page** (desktop): the page the agent drives is the *same* page the human sees — no more acting inside a window you cannot watch;
21
- - **Works on install**: the carrier is chosen automatically (desktop side panel first, otherwise self-hosted), and plain `dsh web` needs no extra configuration;
21
+ - **Automatic carrier selection**: the desktop side panel is preferred when available, otherwise the plugin self-hosts. When the host allows installation scripts and the download is available, the plugin prepares the Electron binary during installation;
22
22
  - **One plugin, one toolset**: installing it gives the agent 34 `dsh_browser_*` tools (open, read, accessibility tree, wait, semantic/coordinate actions, scroll, history navigation, batch and single-control form filling, keys, structured extraction, screenshots, downloads, login-state management).
23
23
 
24
24
  In one line: **install the plugin and you have a real browser shared with, and drivable by, the user's agent.**
@@ -29,22 +29,26 @@ In one line: **install the plugin and you have a real browser shared with, and d
29
29
 
30
30
  > **Updating an installed plugin takes two steps** (since DSH 0.2.1-alpha.2, installing over an installed package fails outright with `already-installed`): run `dsh plugin --profile <profile> remove dsh-builtin-browser` first, then `add` the target version. See the [user guide](docs/user-guide.md) (Chinese).
31
31
 
32
+ > **0.4.16 is being prepared for release**, with security, stability and desktop rc.5 sidebar fixes. Existing users should update once it is published. Updating the plugin does not update the DSH desktop shell, refresh its bridge, or change an existing `ELECTRON_PATH` override. Back up first and follow the [0.4.16 upgrade notes](docs/user-guide.md#升级到-0416) (Chinese).
33
+
32
34
  ### DSH Desktop
33
35
 
34
36
  ```sh
35
37
  dsh plugin --profile desktop add dsh-builtin-browser
36
38
  ```
37
39
 
38
- On the desktop the plugin drives the browser panel inside the **official side panel** — no extra window, no Electron dependency, and the agent operates the very page you see in the interface.
40
+ When the desktop shell provides a controllable `<webview>` and the bridge is installed, the plugin drives the **official side panel**: the agent operates the very page you see. Otherwise it falls back to the plugin's own Electron window.
39
41
 
40
42
  Driving that panel also needs a bridge, installed into **the desktop app's own install directory** rather than the profile:
41
43
 
44
+ **Since 0.5.0 this is one step.** The script closes DSH itself — installing while it runs fails with EBUSY on the archive, and a process that waits for the exit is carried away with it:
45
+
42
46
  ```sh
43
- node desktop-bridge/install.mjs # idempotent; backs up main.js.before-bridge first
44
- node desktop-bridge/install.mjs --revert # roll back
47
+ desktop-bridge/install-and-start.cmd # Windows, double-click or run
48
+ node desktop-bridge/install.mjs "<dir>" --restart # any platform
45
49
  ```
46
50
 
47
- > **Optional**: without the bridge the plugin falls back to self-hosting — identical capability, just one extra standalone window. **Re-run it after every desktop upgrade**, which replaces `resources/app/` and takes the bridge with it.
51
+ > Run this from the updated plugin directory after closing the desktop app and backing up its `resources` directory and browser data. **The bridge is optional**: without it, the plugin uses a standalone window. **Reinstall the bridge with the new script after plugin or desktop shell upgrades**, then restart the desktop app. See [carrier limitations](docs/limitations.md) (Chinese).
48
52
 
49
53
  ### Web (`dsh web`)
50
54
 
@@ -54,11 +58,11 @@ dsh plugin --profile web add dsh-builtin-browser
54
58
 
55
59
  There is **no side panel and no bridge** on the web side: the shared browser is **self-hosted** in a standalone window (titled `dsh-browser`) with a full toolbar (address bar, back/forward/reload, tab strip) you can use like any browser.
56
60
 
57
- > If the Electron binary is missing on first install (44+ no longer downloads it), run `npx install-electron` once as the error suggests — it needs network.
61
+ > 0.4.16 normally prepares the Electron binary through its installation script. DSH rc.5 uses pnpm 11.7 with `strict-dep-builds`, so first installation may require approval of this plugin's build script in the host's native plugin manager; the plugin does not change `allowBuilds`. After `--ignore-scripts` or an explicit download skip, run `npx --no dsh-browser-install-electron` from the correct profile directory to prepare it manually (network required). The command also respects `ELECTRON_SKIP_BINARY_DOWNLOAD`. See the [setup guide](docs/user-guide.md#准备-electron-二进制) (Chinese).
58
62
 
59
63
  ### Both sides
60
64
 
61
- No further configuration; just ask the agent:
65
+ Once installation and any required build script approval are complete, ask the agent:
62
66
 
63
67
  ```
64
68
  Open https://example.com and summarise the main content for me.
@@ -90,7 +94,7 @@ This plugin claims the global **`dsh_browser_*`** namespace (34 tools).
90
94
 
91
95
  **If your log shows `could not register dsh_browser_xxx`**: another plugin holds that name. From 0.4.8 every tool registers **independently**, so a collision costs that one name and nothing else — the check exists so the next collision is visible at a glance rather than starting from "the plugin is broken".
92
96
 
93
- **Who should update to 0.4.8:** only names changed, not behaviour. **If this is your only browser plugin, you do not need to update.** If you also run another browser plugin (Tencent BrowserSkill especially), updating is recommended. The upgrade note is at the end of the [user guide](docs/user-guide.md) (Chinese).
97
+ When upgrading from 0.4.7 or earlier, also replace `browser_*` with `dsh_browser_*` in custom prompts. Follow the current [0.4.16 upgrade notes](docs/user-guide.md#升级到-0416) (Chinese).
94
98
 
95
99
  ## Release history
96
100
 
@@ -98,6 +102,10 @@ The full record — per round, with the cause and the evidence for each fix —
98
102
 
99
103
  | Version | Date | Theme |
100
104
  | --- | --- | --- |
105
+ | **0.5.1** | 2026-10-31 | Adopt the page the browser already shows: `switch_tab` and `open` both land on it instead of opening a second one; canvas detection no longer requires an empty element list; a blank page is judged by its own URL |
106
+ | **0.5.0** | 2026-10-31 | **Remote viewing** (#34) with passive capture; one-step desktop bridge install/repair (#36); a sidebar panel that is merely off-screen is no longer judged a lost carrier (#37); canvas pages and image-only links become visible; CDP sessions reconnect |
107
+ | **0.4.16 (local release candidate)** | 2026-10-31 | Security and stability: concurrent page ownership, downloads/screenshots that refuse overwrite, bridge and settings safeguards, carrier switching recovery, desktop rc.5 sidebar support; Electron `^44.10.0` and binary preparation during installation |
108
+ | **0.4.9**–**0.4.15** | 2026-10-15–19 | Sidebar capability detection and fallback, host contract alignment, headless Chrome/Edge and startup hand-off fixes; see CHANGELOG |
101
109
  | **0.4.8** | 2026-10-14 | **Tool namespace**: 34 tools move to `dsh_browser_*`; one taken name can no longer cost the whole toolset |
102
110
  | **0.4.7** | 2026-10-12 | Three defects of one shape: a hardcoded carrier, a dead host never replaced, a setting read once; takes the four suggestions from #26 |
103
111
  | **0.4.6** | 2026-10-08 | Reading another conversation's sidebar, blank pages spawned while waiting, sign-outs on upgrade |
package/README.md CHANGED
@@ -16,9 +16,9 @@
16
16
 
17
17
  `dsh-builtin-browser` 给 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) 提供浏览器能力:
18
18
 
19
- - **真实页面,而非转播**:页面由**真实的浏览器**承载 —— 桌面端就是官方侧栏里那一个,Web 端是插件拉起的窗口,也可以在设置里改用**你本机的 Chrome / Edge**。用户直接看到 agent 在做什么,随时可以上手接管;
19
+ - **真实页面,而非转播**:页面由**真实的浏览器**承载 —— 桌面端在外壳与 bridge 支持时使用官方侧栏,否则使用插件拉起的窗口;也可以在设置里改用**你本机的 Chrome / Edge**。用户直接看到 agent 在做什么,随时可以上手接管;
20
20
  - **人机同页**(桌面端):agent 操作的页面与人看到的是**同一个**页面 —— 不再是一个你看不见的窗口;
21
- - **装好即用**:载体自动选择(桌面端侧重侧栏 → 否则自托管),纯 `dsh web` 不需要任何额外配置;
21
+ - **自动选择载体**:桌面侧栏可用时优先侧栏,否则自托管;宿主允许安装脚本且下载可用时,插件会在安装阶段准备 Electron 二进制;
22
22
  - **一插件即一套工具**:安装后 agent 自动获得 34 个 `dsh_browser_*` 工具(打开、查看、无障碍树、等待、语义/坐标操作、滚动、回退、批量/单控件填表、按键、结构化提取、截图、下载、登录态管理……)。
23
23
 
24
24
  一句话:**安装插件 = 获得一个与用户共享、可被 agent 驱动的真实浏览器。**
@@ -29,22 +29,29 @@
29
29
 
30
30
  > **更新已安装的插件是两步**(DSH 0.2.1-alpha.2 起,对已装包再装会直接报 `already-installed`):先 `dsh plugin --profile <profile> remove dsh-builtin-browser`,再 `add` 目标版本。详见[用户指南](docs/user-guide.md#先移除再安装)。
31
31
 
32
+ > **0.4.16 正在准备发布**,包含安全、稳定性与桌面 rc.5 侧栏适配修复;现有用户建议在版本发布后更新。插件更新不会更新 DSH 桌面外壳,也不会自动刷新外壳内的 bridge 或已有 `ELECTRON_PATH` 覆盖。先备份,再按[0.4.16 升级说明](docs/user-guide.md#升级到-0416)处理。
33
+
32
34
  ### DSH Desktop(桌面端)
33
35
 
34
36
  ```sh
35
37
  dsh plugin --profile desktop add dsh-builtin-browser
36
38
  ```
37
39
 
38
- 桌面端默认驱动**官方侧栏**里那个浏览器面板 —— 不额外开窗口,也不依赖 Electron,agent 操作的就是你在界面上看到的那一个页面。
40
+ 桌面端在外壳支持可驱动的 `<webview>` 且已安装 bridge 时,驱动**官方侧栏**里那个浏览器面板,agent 操作的就是你在界面上看到的同一页面。侧栏不可驱动时自动使用插件自己的 Electron 窗口。
39
41
 
40
- 要让插件驱动侧栏,还需要一条 bridge(它装在**桌面端自己的安装目录**里,不在 profile 中):
42
+ 要让插件驱动侧栏,还需要一条 bridge(它装在**桌面端自己的安装目录**里,不在 profile 中)。**0.5.0 起可以一步完成**:
41
43
 
42
44
  ```sh
43
- node desktop-bridge/install.mjs # 幂等;首次会备份 main.js.before-bridge
44
- node desktop-bridge/install.mjs --revert # 回滚
45
+ # Windows:双击即用,或
46
+ desktop-bridge/install-and-start.cmd
47
+
48
+ # 任意平台:脚本自己关闭 DSH、安装、再启动
49
+ node desktop-bridge/install.mjs "<DSH Desktop 安装目录>" --restart
45
50
  ```
46
51
 
47
- > **这不是必做项**:不装 bridge,插件自动退回自托管 —— 功能完全一样,只是会多出一个独立窗口。**桌面端升级后要重跑一次**,因为升级会替换 `resources/app/`,bridge 随之消失。
52
+ `--restart` 由脚本自己关闭桌面端 —— 不要在运行中手工安装:归档被运行中的 Electron 占用,`rename` 会以 `EBUSY` 失败,而"等它退出再装"的守护进程会被一起带走(实测两种拉起方式都如此)。`--restart` 会提示确认,`--yes` 跳过。不带 `--restart` 时脚本仍要求你先关闭桌面端。
53
+
54
+ > **bridge 是可选项**:不装时自动退回自托管,多出一个独立窗口。**插件或桌面外壳升级后,重跑同一条命令即可修复** —— 桌面端升级会恢复 `app.asar`,桥随之失效,此时 `bridge-status` 报 `stale`。设置在面板顶部可见。载体差异见[已知限制](docs/limitations.md)。
48
55
 
49
56
  ### Web 端(`dsh web`)
50
57
 
@@ -54,11 +61,11 @@ dsh plugin --profile web add dsh-builtin-browser
54
61
 
55
62
  Web 端**没有侧栏,也没有 bridge**:共享浏览器由插件**自托管**拉起一个独立窗口(标题 `dsh-browser`),自带完整工具栏(地址栏 / 后退前进刷新 / 标签条),你可以像用普通浏览器一样直接用它。
56
63
 
57
- > 首次安装若缺少 Electron 二进制(44+ 不再随安装下载),按报错提示执行一次 `npx install-electron`,需要网络。
64
+ > 0.4.16 通常会通过安装脚本准备 Electron 二进制。DSH rc.5 的 pnpm 11.7 使用 `strict-dep-builds`,首次安装可能需在宿主原生插件管理器中批准本插件的构建脚本;插件不会自行修改 `allowBuilds`。使用 `--ignore-scripts` 或明确跳过下载后,可在正确的 profile 目录执行 `npx --no dsh-browser-install-electron` 手动准备(需网络)。若设置了 `ELECTRON_SKIP_BINARY_DOWNLOAD`,该命令也会遵守跳过选择。详见[用户指南](docs/user-guide.md#准备-electron-二进制)。
58
65
 
59
66
  ### 两端通用
60
67
 
61
- 装完不需要其它配置,直接让 agent 用它:
68
+ 完成安装与所需的构建脚本批准后,直接让 agent 用它:
62
69
 
63
70
  ```
64
71
  帮我打开 https://example.com,把页面上的主要内容用中文总结一下。
@@ -66,6 +73,33 @@ Web 端**没有侧栏,也没有 bridge**:共享浏览器由插件**自托管**
66
73
 
67
74
  浏览器窗口会随第一次调用出现;你可以随时在那个窗口里自己操作,agent 会接着往下走。**两端都可以在设置里改用你本机已安装的 Chrome / Edge**,那是行为完全一致的选项。
68
75
 
76
+ ## 远程观看浏览器(0.5.0 新增)
77
+
78
+ 通过 LAN 或隧道从另一台设备操作 DSH 时,浏览器窗口在主机显示器上,远程看不到 agent 在做什么。0.5.0 补上了只读画面:
79
+
80
+ **默认关闭。** 主机在设置里打开 `remoteView.enabled` 之后,页面才会提供画面;关闭状态下端点不返回图像、不透露目标信息。**不需要安装或改动其他插件** —— LAN 场景走宿主自己的 web server。
81
+
82
+ 面板是一个悬浮入口(右下角"观看浏览器"),显示当前任务的画面、只读标记、状态与停止按钮。拉帧是**一帧一请求**:显示完上一帧才请求下一帧,慢网络自然降速而不堆积。
83
+
84
+ | 项目 | 默认值 |
85
+ | --- | --- |
86
+ | 帧率 | 2 fps(每 500 ms 一帧,上一帧绘制完成才请求) |
87
+ | 编码 | JPEG,质量 70,等比缩放到 1280×720 内 |
88
+ | 采集 | 被动:不抢焦点、不切标签、不展开窗口、不自动恢复载体 |
89
+ | 存储 | 不落盘、不进入聊天或模型上下文 |
90
+
91
+ **第一版只读**:不转发点击、键盘、滚轮,不提供地址栏或远程切换原生标签。
92
+
93
+ 三个端点,都在 `/dsh-builtin-browser/browser-view/` 下,仅同源可访问:
94
+
95
+ | 端点 | 用途 |
96
+ | --- | --- |
97
+ | `GET sessions` | 面板用来取得可观看的会话 id(只有 id,无 URL/标题) |
98
+ | `GET frame?session=…` | 一张 JPEG |
99
+ | `GET …/bridge-status` | 桌面 bridge 的安装状态 |
100
+
101
+ 画面可能包含验证码、账户信息或登录后内容 —— 打开前请确认这是你要看的页面。
102
+
69
103
  ## 文档
70
104
 
71
105
  | 目标 | 入口 |
@@ -90,7 +124,7 @@ Web 端**没有侧栏,也没有 bridge**:共享浏览器由插件**自托管**
90
124
 
91
125
  **如果你日志里出现 `could not register dsh_browser_xxx`**:说明有另一个插件占了同一个名字。0.4.8 起每个工具**独立注册**,所以碰撞只影响那一个名字,其余工具照常可用 —— 这条检查就是为了让下次撞名一眼可见,而不是从"插件坏了"开始排查。
92
126
 
93
- **谁需要更新 0.4.8**:只有名字变了,功能一字未改。**只装这一个浏览器插件的人不必更新**;装了其它浏览器插件(尤其腾讯 BrowserSkill)的人建议更新。详见[用户指南的升级说明](docs/user-guide.md#从-047-升级到-048)。
127
+ 从 0.4.7 或更早版本升级时,还需把自定义提示词里的 `browser_*` 改为 `dsh_browser_*`。当前升级建议以 [0.4.16 升级说明](docs/user-guide.md#升级到-0416)为准。
94
128
 
95
129
  ## 更新记录
96
130
 
@@ -98,6 +132,10 @@ Web 端**没有侧栏,也没有 bridge**:共享浏览器由插件**自托管**
98
132
 
99
133
  | 版本 | 日期 | 主题 |
100
134
  | --- | --- | --- |
135
+ | **0.5.1** | 2026-10-31 | 接管浏览器自己打开的页面:`switch_tab` 与 `open` 都能落到你正在看的那一页,不再另开一个;canvas 检测不再要求元素列表为空;空白页改由页面自身 URL 判定 |
136
+ | **0.5.0** | 2026-10-31 | **远程观看浏览器**(#34)与**主动采集**;桌面 bridge 一键安装/修复(#36);侧栏"面板只是没显示"不再被判为载体损失(#37);canvas 页面与图片链接可见;CDP 会话自动重连 |
137
+ | **0.4.16** | 2026-10-31 | 安全与稳定性:并发选页隔离、下载/截图禁止覆盖、bridge 与设置门控加固、载体切换恢复、桌面 rc.5 侧栏适配;Electron `^44.10.0` 与安装阶段二进制准备 |
138
+ | **0.4.9**–**0.4.15** | 2026-10-15–19 | 侧栏能力探测与回退、宿主契约对齐、本机 Chrome/Edge 无显示启动与启动移交修复;详见 CHANGELOG |
101
139
  | **0.4.8** | 2026-10-14 | **工具名空间**:34 个工具移入 `dsh_browser_*`,一个名字被占不再毁掉整套工具 |
102
140
  | **0.4.7** | 2026-10-12 | 三个"同形"缺陷:载体被写死、宿主死了不换、设置读了不生效;收 #26 的四条建议 |
103
141
  | **0.4.6** | 2026-10-08 | 跨会话读错侧栏、等待期间误建空白页、升级把浏览器登出 |