dsh-browser-cdp 1.14.2 → 1.14.3
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.
- package/CHANGELOG.md +13 -0
- package/bin/cdp-render-worker.mjs +8 -0
- package/dsh-plugin.json +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,16 @@
|
|
|
1
|
+
## 1.14.3 (2026-11-22)
|
|
2
|
+
|
|
3
|
+
**img-in-link 点击误报收口(#17):`nodeContains` 先请求 document,祖先/后代容错从死代码变回活防护。**
|
|
4
|
+
|
|
5
|
+
上游 issue [#17](https://github.com/drscrewdriver/dsh-browser-cdp/issues/17)(同 #16 报告者,-32000 行号级定位)。worker 的 `nodeContains()` 调 `DOM.pushNodesByBackendIdsToFrontend` 前从未 `DOM.getDocument`(`grep -c getDocument` = 0),Chrome 一律回 `-32000 Document needs to be requested first`,被 try/catch 吞掉后恒返回 false —— 「命中点可能是目标的后代」这层容错整段失效。裸目标的点击不受影响(`hitBackendId === targetBackendId` 有短路),只有**目标中心点最顶层是其后代元素**时才走死路:`<a><img></a>`、svg-in-button 等嵌套结构在 pre-check 就被判 `click-missed`,**点击根本没派发**。
|
|
6
|
+
|
|
7
|
+
- **修复**:`nodeContains` 内、push 之前补 `await call('DOM.getDocument', {})`(worker 免构建产物,改文件即生效)。不缓存是刻意的:同进程导航会使映射失效,而本路径每次点击至多两次(pre/post 各一),depth=1 的 getDocument 开销可忽略 —— 缓存反而要为 worker 不处理事件的消循环引入 `DOM.documentUpdated` 监听。
|
|
8
|
+
- **实测转绿**(Chrome 158 headless,issue 复现法):修复前 `ok=False code=click-missed`("candidate measured to 40,20 but that point resolves to backendNodeId 8");修复后同一锚点 `ok=True code=ok`,点击真实派发并带 recorded 忠实记录。
|
|
9
|
+
- **契约测试**:worker-dispatch 套件新增序数断言(getDocument 先于 push),防回归方式与既有 reload-before-guard 用例一致。
|
|
10
|
+
- **边界**:跨文档导航后 post-check 的降级路径(afterHref 导航判定)零改动;backendNodeId 跨文档复用的理论边角在 effects 契约层两种路径都产出 `ok:true`(`navigated` 标志 src 侧无消费方),无回归。
|
|
11
|
+
|
|
12
|
+
门禁:`npm run typecheck` 干净;`npm test` **1337 passed / 13 skipped**(+1 契约用例);worker 为直维护 .mjs 无构建面,lib 未动。
|
|
13
|
+
|
|
1
14
|
## 1.14.2 (2026-11-22)
|
|
2
15
|
|
|
3
16
|
**jev_* 捕获必失败修复(#16):`linkId` 与 `targetId` 语义分离 + 不再丢弃已产出的捕获。**
|
|
@@ -330,6 +330,14 @@ async function nodeContains(targetBackendId, hitBackendId) {
|
|
|
330
330
|
if (!Number.isFinite(hitBackendId) || hitBackendId <= 0) return false
|
|
331
331
|
if (hitBackendId === targetBackendId) return true
|
|
332
332
|
try {
|
|
333
|
+
// `pushNodesByBackendIdsToFrontend` refuses until a document has been
|
|
334
|
+
// requested (-32000 "Document needs to be requested first"). Nothing else
|
|
335
|
+
// in this worker ever asks for one, so every call here used to throw and
|
|
336
|
+
// the ancestor/descendant tolerance was dead code — an <a> wrapping an
|
|
337
|
+
// <img> was misreported as click-missed (issue #17). Uncached on purpose:
|
|
338
|
+
// a navigation inside this process invalidates the mapping, and this path
|
|
339
|
+
// runs at most twice per click.
|
|
340
|
+
await call('DOM.getDocument', {})
|
|
333
341
|
const pushed = await call('DOM.pushNodesByBackendIdsToFrontend', { backendNodeIds: [targetBackendId, hitBackendId] })
|
|
334
342
|
const [targetNodeId, hitNodeId] = pushed?.nodeIds ?? []
|
|
335
343
|
if (!targetNodeId || !hitNodeId) return false
|
package/dsh-plugin.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-browser-cdp",
|
|
3
|
-
"version": "1.14.
|
|
3
|
+
"version": "1.14.3",
|
|
4
4
|
"description": "dsh-browser-cdp: visible agent browser for DSH — drives the vendored ego-compatible Chromium over CDP, and can also attach to a running Chrome/Edge/Brave or route through egolite, Tabbit and Lightpanda backends. 35 structured bcdp_* tools; only bcdp_status stays resident by default (lazy injection, −91.9% schema per turn for non-browser sessions). Realtime watch panel with direct click/scroll/IME input, element picks quoted into the composer, human-verification notices; non-CDP channels sync frames by 3s polling. Web shell: floating watch ball without dsh-better-sidebar, sidebar tab with it. Headless/TUI hosts: tools-only. [DSH 0.1.0-rc.2 ~ 0.2.2-rc.1: declarative settings via Config .volatile() fields on 0.1.7+; imperative installSection / module-level registration + describe/mutate bridge on 0.1.0 ~ 0.1.5 (experimental, pending farm). Client peers stay optional so gen-1 hosts without dsh-client-store still load; for a production install on the current line use the 0.17.x line]",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./lib/index.js",
|