Repository navigation
Tabs now survive crashes, and a release can no longer ship untested.
Fixed: tabs lost after a crash or restart
If the MCP server died (or was force-killed) shortly after opening tabs, the next start could come back with only one tab — or none. Three separate causes, all fixed:
- Tab structure changes were only coalesced for 600 ms before being written. Tab add/close now persist immediately; navigation URLs still coalesce.
- The persisted session was read too late — the startup blank page was adopted and saved first, overwriting the file the restore step was about to read.
- A new tab reported
about:blankat creation time. That blank URL was what survived a crash and got filtered out on restore; the real URL now triggers a save as soon as it arrives.
Also fixed: two concurrent saves could fight over the same .tmp file (single-flight guard added), and shutdown now forces a save while skipping per-tab title lookups, so quitting never lags.
Fixed: Linux process cleanup could kill the server itself
On macOS/Linux the orphan-browser cleanup matched the whole command line for chrome|msedge. The server's own --channels chrome,msedge argument matched, so the server killed its own process. It now matches the executable name only. Windows was unaffected (it filters by process name).
Changed: releases are gated on tests
New ci.yml runs build + version check + the full smoke suite headless on ubuntu-latest and windows-latest for every push and PR. publish.yml reuses it via workflow_call and now needs it — a v* tag can no longer publish an untested package.
The smoke suite grew from 40 to 42 checks, including a new case that opens 3 tabs, SIGKILLs the server 200 ms later, and asserts all 3 come back. That test was red before the persistence fix.
Also in this release
- Cross-platform orphan-process cleanup (
pson macOS/Linux, process query on Windows). - Cursor plugin manifest, plus listings on LobeHub, Glama, mcpservers.org and awesome-mcp-servers.
- CI badge on both READMEs.
Install
npx browser-ref-mcp@0.2.1
# or
npm i -g browser-ref-mcp@0.2.1Published with provenance — verify with npm audit signatures.
中文说明
标签再也不怕崩了,发布也不会再发出去没测过的包。
修复:崩溃或重启后丢失标签
MCP server 在开完标签后不久挂掉(或被强杀),下次启动可能只剩一个标签、甚至一个都没有。三个独立原因,都已修掉:
- 标签结构变化原本要等 600ms 合流才落盘。现在新增/关闭标签立即落盘,导航 URL 仍走合流避免狂写。
- 持久化会话读得太晚:启动时那个空白页先被 adopt 并落盘,把恢复步骤要读的文件覆盖成了「一个空白页」。
- 新标签创建时 URL 还是
about:blank。崩溃时留下的就是这个空白地址,恢复时又被当空标签过滤掉;现在真实 URL 一到就立即落盘。
另外还修了两处:并发保存会争抢同一个 .tmp 文件(已加单飞保护),退出时会强制落盘并跳过逐个取标题,不会拖慢关闭。
修复:Linux 上清理进程会把 server 自己杀掉
macOS/Linux 上清理孤儿浏览器的逻辑按整行命令行匹配 chrome|msedge,而 server 自己的 --channels chrome,msedge 参数正好命中,于是把自己 SIGKILL 了。现在只匹配可执行文件名。Windows 不受影响(按进程名过滤)。
变更:发布必须先过测试
新增 ci.yml,每次 push / PR 都在 ubuntu-latest 与 windows-latest 上跑 build + 版本校验 + 全量无头冒烟测试。publish.yml 通过 workflow_call 复用并 needs 它——推 v* tag 再也不可能发出没测过的包。
冒烟测试从 40 项增至 42 项,新增用例会开 3 个标签、200ms 后 SIGKILL server,断言 3 个全部恢复。修复之前这条是红的。
其他
- 跨平台的孤儿进程清理(macOS/Linux 用
ps,Windows 用进程查询)。 - Cursor 插件清单;上架 LobeHub、Glama、mcpservers.org、awesome-mcp-servers。
- 两个 README 都加了 CI 徽章。
安装
npx browser-ref-mcp@0.2.1
# 或
npm i -g browser-ref-mcp@0.2.1带 provenance 发布,可用 npm audit signatures 校验。