From aff886d192fd9e3579c1b8bf08e52f623a455ac8 Mon Sep 17 00:00:00 2001 From: zizi Date: Wed, 17 Jun 2026 01:16:56 +0000 Subject: [PATCH] =?UTF-8?q?docs(skill):=20ui-walkthrough-cdp=20=E7=BA=A2?= =?UTF-8?q?=E7=BA=BF=E2=80=94=E2=80=94=E9=9D=9E=E5=AE=89=E5=85=A8=E4=B8=8A?= =?UTF-8?q?=E4=B8=8B=E6=96=87(IP/http)crypto.subtle=20=E7=BC=BA=E9=99=B7?= =?UTF-8?q?=E5=B7=B2=E4=BF=AE(4e486f60)+=E9=97=A8=E7=A6=81=E7=BB=8Flocalho?= =?UTF-8?q?st=E7=B3=BB=E7=BB=9F=E6=80=A7=E6=8E=A9=E7=9B=96=E4=B8=8A?= =?UTF-8?q?=E4=B8=8B=E6=96=87=E4=BE=9D=E8=B5=96=E7=BC=BA=E9=99=B7=E7=9A=84?= =?UTF-8?q?=E8=A1=80=E6=B3=AA=E6=95=99=E8=AE=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 走查环境 localhost=安全上下文,会掩盖 crypto.subtle/isSecureContext 等门控特性缺陷; 用户可见 UI/e2e 必须另跑真实访问 origin(IP/明文http)。当走查需 workaround 避开某失败时, 先问真实用户是否同样撞上——本次线上游戏「加载失败」即此坑被当走查技巧记着、没当产品缺陷修。 Co-Authored-By: Claude Opus 4.8 (1M context) --- .agents/skills/ui-walkthrough-cdp.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.agents/skills/ui-walkthrough-cdp.md b/.agents/skills/ui-walkthrough-cdp.md index 8883fc06..e9d972fe 100644 --- a/.agents/skills/ui-walkthrough-cdp.md +++ b/.agents/skills/ui-walkthrough-cdp.md @@ -6,7 +6,8 @@ ## 1. 大原则 - **chrome 一律在 mini-desktop 本地起**(6c6g 连续 exit 144,该路线已作废);被测前端/后端同机,全 localhost。 -- 浏览器内访问前端必须 **`http://localhost:4173`**(非 Tailscale IP):宿主 manifest 校验用 `crypto.subtle`,仅安全上下文(https/localhost)可用,走 IP 会永远 demo 兜底。 +- 浏览器内访问前端**优先 `http://localhost:4173`**(安全上下文,省心)。**经 Tailscale IP/明文 http 现也可用**:宿主 manifest 校验的 `crypto.subtle` 在非安全上下文缺失,已补纯 JS SHA-256 兜底(2026-06-17 `4e486f60`),不再「走 IP 永远 demo 兜底」。 +- **红线(此坑血泪)**:上条「IP→demo 兜底」曾被当成「走查改用 localhost 规避」记着,却没意识到**创始人/真实用户正是经 IP 访问 → 线上游戏一直「加载失败」**(demo 退化后 W-CLEAN 占位发 game_error)。教训:**走查环境 localhost = 安全上下文,会系统性掩盖「上下文依赖缺陷」(`crypto.subtle`、`isSecureContext` 门控特性等);用户可见 UI/e2e 走查必须另跑一遍真实访问 origin(IP/明文 http),不能只在 localhost 取证。当走查需要一个 workaround 才能避开某失败时,先问「真实用户会不会也撞上同一失败」。** - chrome 起后必先 `curl -s localhost:9222/json/version` 验活再用。 ## 2. CDP 七坑(Chrome 146 实证,逐个血泪)