dsh-browser-cdp 1.14.3 → 1.14.4
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 +14 -0
- package/bin/cdp-render-worker.mjs +16 -3
- package/dsh-plugin.json +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## 1.14.4 (2026-11-22)
|
|
2
|
+
|
|
3
|
+
**点击未映射点位按 unverified 放行(#18):`Number(undefined)` 的 NaN 比较不再把「未知」折叠成「确定 miss」。**
|
|
4
|
+
|
|
5
|
+
上游 issue [#18](https://github.com/drscrewdriver/dsh-browser-cdp/issues/18)(同 #16/#17 报告者)。pre/post 两处 `getNodeForLocation` 判定用 `Number(hit?.backendNodeId) !== backendNodeId` 比较——点位解析不到节点时 `Number(undefined)` 是 NaN,`NaN !== x` 恒真,`nodeContains(target, NaN)` 又在 `Number.isFinite` 守卫处短路返回 false:**「那里没有节点」被当成「有东西挡在上面」**。pre-check 由此不派发点击;post-check 报 miss 诱发上层重试 → 重复点击(#9 #5 同款失败模式,afterHref 分支只救了导航场景)。
|
|
6
|
+
|
|
7
|
+
- **与 #17 不重复**:#17 修在 `nodeContains` 内部(push 前补 getDocument,1.14.3),NaN 路径在 `Number.isFinite` 短路处**根本走不到 push**——1.14.3 之后本 issue 依旧存在;本版修在调用侧,两者无交集。报告者建议中的双向 `nodeContains(hitId, targetId)` 未采纳:点到祖先容器算命中的语义放宽无实证场景,且弱化 overlay 防护。
|
|
8
|
+
- **修复**:两处判定引入 `hitId`/`hitMissing`(`!Number.isFinite(hitId) || hitId <= 0`)守卫——`!hitMissing && hitId !== backendNodeId && !nodeContains(...)` 才判 miss。pre-check 未映射点位放行点击(盒模型刚量到目标确实在;点空由 jev verify 兜底);post-check 放行落到 `ok:true`(点击已派发无法撤销)。hitId 有效但不匹配时 miss 分支原样保留——overlay 防护零弱化。
|
|
9
|
+
- **stub 代理 E2E 三组对照**(确定性复现:本地 CDP 代理仅把 `getNodeForLocation` 响应改写后转发):旧 worker(v1.14.3) + 空改写 → `click-missed "…backendNodeId undefined"`(issue 原文逐字);新 worker + 空改写 → `ok=True code=ok`(点击派发);新 worker + 改写为其他有效节点(424242) → 仍 `click-missed`(防护保住)。
|
|
10
|
+
- **契约测试**:worker-dispatch 套件新增用例——hitMissing/afterMissing 守卫存在、旧 NaN 比较式消失、守卫先于 nodeContains 判定。
|
|
11
|
+
- **边界**:post-check 的 afterHref 导航判定分支零改动;`navigated` 标志 src 侧无消费方,hitMissing 放行路径不造无人读的 flag。
|
|
12
|
+
|
|
13
|
+
门禁:`npm run typecheck` 干净;`npm test` **1338 passed / 13 skipped**(+1 契约用例);worker 为直维护 .mjs 无构建面,lib 未动。
|
|
14
|
+
|
|
1
15
|
## 1.14.3 (2026-11-22)
|
|
2
16
|
|
|
3
17
|
**img-in-link 点击误报收口(#17):`nodeContains` 先请求 document,祖先/后代容错从死代码变回活防护。**
|
|
@@ -422,13 +422,21 @@ async function actOnCandidate(params) {
|
|
|
422
422
|
const hit = await call('DOM.getNodeForLocation', {
|
|
423
423
|
x: Math.round(measured.centre.x), y: Math.round(measured.centre.y), includeUserAgentShadowDOM: false,
|
|
424
424
|
})
|
|
425
|
-
|
|
425
|
+
const hitId = Number(hit?.backendNodeId)
|
|
426
|
+
const hitMissing = !Number.isFinite(hitId) || hitId <= 0
|
|
427
|
+
// "No node at that point" is UNVERIFIED, not a miss (issue #18): the NaN
|
|
428
|
+
// comparison folded an unknown answer into "something is on top of it".
|
|
429
|
+
// An overlay answers with a NODE; an unmapped point (mutation race between
|
|
430
|
+
// the box model and this read, renderer-mapping limits) must not block the
|
|
431
|
+
// click the box model just measured — and in the post-check below it must
|
|
432
|
+
// not trigger a caller retry that double-clicks (issue #9 #5's failure mode).
|
|
433
|
+
if (!hitMissing && hitId !== backendNodeId && !(await nodeContains(backendNodeId, hitId))) {
|
|
426
434
|
const at = Math.round(measured.centre.x) + ',' + Math.round(measured.centre.y)
|
|
427
435
|
return {
|
|
428
436
|
ok: false,
|
|
429
437
|
code: 'click-missed',
|
|
430
438
|
message: 'candidate measured to ' + at + ' but that point resolves to backendNodeId ' +
|
|
431
|
-
String(
|
|
439
|
+
String(hitId) + ' - something is on top of it or the page moved',
|
|
432
440
|
}
|
|
433
441
|
}
|
|
434
442
|
|
|
@@ -453,7 +461,12 @@ async function actOnCandidate(params) {
|
|
|
453
461
|
const after = await call('DOM.getNodeForLocation', {
|
|
454
462
|
x: Math.round(measured.centre.x), y: Math.round(measured.centre.y), includeUserAgentShadowDOM: false,
|
|
455
463
|
})
|
|
456
|
-
|
|
464
|
+
const afterId = Number(after?.backendNodeId)
|
|
465
|
+
const afterMissing = !Number.isFinite(afterId) || afterId <= 0
|
|
466
|
+
// Same rule as the pre-check: an unmapped point is unverified (issue #18),
|
|
467
|
+
// not evidence that something is on top of the target — a miss here would
|
|
468
|
+
// make the caller retry an already-dispatched click.
|
|
469
|
+
if (!afterMissing && afterId !== backendNodeId && !(await nodeContains(backendNodeId, afterId))) {
|
|
457
470
|
// The node changed. If the URL changed too, the click navigated — that is a
|
|
458
471
|
// success, not a miss. Only report click-missed when neither the node family
|
|
459
472
|
// nor the URL accounts for the change.
|
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.4",
|
|
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",
|