dsh-lan-guard 0.4.4 → 0.4.5
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 +18 -0
- package/README.md +5 -1
- package/README.zh.md +5 -1
- package/lib/index.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.4.5] — 2026-09-29(长会话延迟挂载时,裁剪补偿不再提前收工)
|
|
4
|
+
|
|
5
|
+
**现象**:0.4.4 之后,部分长会话在手机上依旧「只有一小段、拖不到底」,而同一条会话在宽屏/桌面完全正常。
|
|
6
|
+
|
|
7
|
+
**根因**:`run()` 在 `convScrolls()` 为真时立刻 `done=true` 收工,而 `fixClip()` 每次只处理当次已存在的被裁层。长会话的正文是**后挂载**的——官方滚动层先拿到少量可滚范围(本次实测仅 336px),`EvIC1a_frame` 稍后才以 `overflow:hidden` 锁死高度。于是补偿恰好在最需要它的那一刻已经停止轮询;真机上表现为注入标记在、`fixClip()` 的补偿逻辑在,却没有留下任何内联修补。
|
|
8
|
+
|
|
9
|
+
**修法**:`convScrolls()` 为真时不再结束,改为保留原有的每 1.5s、最多 30 次(约 45s)轮询窗口,等延迟出现的裁剪层交给 `fixClip()` 释放;补偿成功或回退分支成功才收工。`fixClip()` 自身「可滚范围没有变大就整体回退」的自检不变。
|
|
10
|
+
|
|
11
|
+
**真机验收**(iPhone 16 Pro Max / iOS 27,经代理 3081,同一长会话):
|
|
12
|
+
|
|
13
|
+
| | 修复前 | 修复后 |
|
|
14
|
+
| --- | --- | --- |
|
|
15
|
+
| 官方滚动层 client / scroll | 668 / 1004 | 668 / 7557 |
|
|
16
|
+
| 可滚范围 | **336** | **6889** |
|
|
17
|
+
| 滚动层内部被裁层 | 1(`EvIC1a_frame` 796 高、`overflow:hidden`) | **0** |
|
|
18
|
+
|
|
19
|
+
官方「回到底部」按钮仍在屏内(y=538),未复现 0.4.4 修过的 sticky 回退;脚本仍只在窄屏 + 移动 UA 下运行,宽屏与桌面不受影响。
|
|
20
|
+
|
|
3
21
|
## [0.4.4] — 2026-09-29(补偿 DSH `0.2.0-rc.1` 的会话裁剪回归)
|
|
4
22
|
|
|
5
23
|
**现象**(真机 iPhone 16 Pro Max / iOS 27,经代理的 3081):会话内容看得见,但**手指几乎拖不动、打开会话也不停在最新消息**。
|
package/README.md
CHANGED
|
@@ -147,11 +147,15 @@ The plugin reads its config from its Cordis entry. **Every key has a usable defa
|
|
|
147
147
|
|
|
148
148
|
## Compatibility
|
|
149
149
|
|
|
150
|
-
Current version: plugin **`0.4.
|
|
150
|
+
Current version: plugin **`0.4.5`**; the mobile clip compensation no longer gives up while a long transcript is still hydrating, so a late `overflow:hidden` layer is released too (verified on DeepSeek Harness **`0.2.0-rc.1`**, `0.1.7-rc.2`).
|
|
151
151
|
|
|
152
152
|
| Plugin | Verified DeepSeek Harness | What this version is |
|
|
153
153
|
| --- | --- | --- |
|
|
154
|
+
| **`0.4.5`** | **`0.2.0-rc.1`**, `0.1.7-rc.2` | Long transcripts hydrate after the official scroller has already picked up a small scroll range; the mobile clip compensation treated that intermediate state as healthy and stopped, so a late `overflow:hidden` layer was never released (measured on device: 336px of scroll range with 1 clipped layer inside the scroller). It now keeps looking inside the existing polling window and releases the late layer — 336px → 6889px, 1 clipped layer → 0, official "back to bottom" still on screen |
|
|
154
155
|
| **`0.4.4`** | **`0.2.0-rc.1`**, `0.1.7-rc.2` | iOS session scrolling on DSH `0.2.0-rc.1`: an inner `overflow:hidden` layer with a locked height clipped the conversation (measured on device: 21083px of content behind a 336px scroll range), so a session did not open at the newest message and barely dragged. `mobileScrollFix` now grows that inner layer and drops its scroll-container role, restoring 20675px — verified on device with the composer still pinned and the official "back to bottom" button back in place |
|
|
156
|
+
| **`0.4.3`** | **`0.2.0-rc.1`**, `0.1.7-rc.2`, `0.1.7-rc.1` | Direction change: fix the mobile **height chain** instead of patching `overflow` — a definite height for `html/body/#root`, `100dvh` on the shell and `min-height:0` along the clipping chain, self-checked and reverted wholesale when the official scroll layer still does not scroll; removes the self-made "back to bottom" button and every `overflow-y`/`-webkit-overflow-scrolling` patch; declares DSH `0.2.0-rc.1` and widens the `dsh`/peer ranges to `<0.3.0` |
|
|
157
|
+
| **`0.4.2`** | `0.1.7-rc.2` | The official "back to bottom" button restored: the narrow-screen correction left the conversation's own scroll layer without a growing height, so the official button never believed it was away from the end — the plugin supplies one while hidden and yields as soon as the official one works; also reverts its `overflow-y` patch whenever a full-screen mask or dialog opens (the drawer-scrim regression) |
|
|
158
|
+
| **`0.4.1`** | `0.1.7-rc.2` | First cut of `mobileScrollFix` for "the chat area cannot be dragged on a phone": applies touch-scrollable treatment only when narrow viewport + mobile UA + the page cannot scroll + a clipped overflowing layer is found, and never touches an already-scrolling page; adds the `?lgdiag=1` layout report; measured on device, 86.4s of connection survival with heartbeat answering |
|
|
155
159
|
| **`0.4.0`** | **`0.1.7-rc.2`**, `0.1.7-rc.1` | Mobile long-connection self-healing: the proxy answers DSH's WebSocket heartbeat (measured: 6 s reap without it, 20 s+ survival with it); page patches adding a socket watchdog and mobile compatibility shims; a connection health check and relay counters on the "connection" tab |
|
|
156
160
|
| **`0.3.6`** | **`0.1.7-rc.2`**, `0.1.7-rc.1` | Adding a workspace from a remote device: the browser half shadows the official directory flow (the local browser keeps the OS dialog, a remote device gets an in-page browser and can unlock inside it); fixes the proxy dropping the plugin's admin cookie in both directions, which made `password_unlock` meaningless remotely; adds the missing "remote management rights" control; moves the "saved" confirmation to a top-right notification; reworks status-surface colours against measured contrast; fixes the picker's crushed breadcrumb/shortcut rows |
|
|
157
161
|
| **`0.3.5`** | **`0.1.7-rc.2`**, `0.1.7-rc.1` | Connection-level visibility: an `http://` request to the TLS port goes from "blank page + no log" to a 301 onto `https` with a log line; a deleted device record no longer locks that browser out (revoked/blocked still refuse); the removal-page copy follows |
|
package/README.zh.md
CHANGED
|
@@ -147,11 +147,15 @@ dsh plugin --profile web add "link:$(pwd)"
|
|
|
147
147
|
|
|
148
148
|
## 兼容性
|
|
149
149
|
|
|
150
|
-
当前版本:插件 **`0.4.
|
|
150
|
+
当前版本:插件 **`0.4.5`**;长会话正文后挂载时,移动端裁剪补偿不再提前收工,晚出现的 `overflow:hidden` 层同样会被放行(已在 DeepSeek Harness **`0.2.0-rc.1`**、`0.1.7-rc.2` 上验证)。
|
|
151
151
|
|
|
152
152
|
| 插件 | 已验证的 DeepSeek Harness | 这个版本是什么 |
|
|
153
153
|
| --- | --- | --- |
|
|
154
|
+
| **`0.4.5`** | **`0.2.0-rc.1`**、`0.1.7-rc.2` | 长会话的正文是在官方滚动层拿到少量可滚范围**之后**才挂载的,旧逻辑把这个中间态当成「已正常」收工,晚出现的 `overflow:hidden` 层再也没人放行(真机实测:可滚范围 336px、滚动层内部仍有 1 层被裁)。现在改为在既有轮询窗口内继续侦测并放行迟到的裁剪层:可滚范围 336px → 6889px,被裁层 1 → 0,官方「回到底部」仍在屏内 |
|
|
154
155
|
| **`0.4.4`** | **`0.2.0-rc.1`**、`0.1.7-rc.2` | 修好 DSH `0.2.0-rc.1` 上的 iOS 会话滚动:官方滚动层内部有一层 `overflow:hidden` 且高度锁死,把会话内容裁掉(真机实测:21083px 的内容只换来 336px 可滚范围),表现为打开会话不在最新、手指几乎拖不动。`mobileScrollFix` 现在让该层长高并脱离滚动容器身份,可滚范围恢复到 20675px;真机验收同时确认输入框仍吸底、官方「回到底部」按钮回到原位 |
|
|
156
|
+
| **`0.4.3`** | **`0.2.0-rc.1`**、`0.1.7-rc.2`、`0.1.7-rc.1` | 方向修正:不再给内容层打 `overflow` 补丁,改修移动端**高度链**——给 `html/body/#root` 确定高度、shell 用 `100dvh`、沿被裁层补 `min-height:0`,并自检「官方滚动层真的能滚」否则整体回退;移除自建「回到底部」按钮与全部 `overflow-y`/`-webkit-overflow-scrolling` 补丁;声明 DSH `0.2.0-rc.1` 并把 `dsh`/peer 范围放宽到 `<0.3.0` |
|
|
157
|
+
| **`0.4.2`** | `0.1.7-rc.2` | 找回官方「回到底部」按钮:窄屏矫正让 conversation 自己的滚动层高度不再增长,官方按钮因此永远认为还在尾部——插件在官方按钮缺席时补一个,官方按钮一恢复就自动让位;同时修复矫正的 `overflow-y` 补丁与全屏遮罩打架导致侧边栏被灰雾盖住的回归 |
|
|
158
|
+
| **`0.4.1`** | `0.1.7-rc.2` | `mobileScrollFix` 首版,修「手机上聊天区滑不动」:仅在「窄屏 + 移动 UA + 整页不可滚 + 找到被裁剪溢出的层」四条同时成立时才处理,正常页面一律不碰;新增 `?lgdiag=1` 布局诊断;真机实测连接存活 86.4 秒 |
|
|
155
159
|
| **`0.4.0`** | **`0.1.7-rc.2`**、`0.1.7-rc.1` | 手机长连接自愈:代理代答 DSH 的 WebSocket 心跳(实测把「停回心跳 6 秒被切断」变成「20 秒以上存活」);页面补丁加入断线看门狗与移动端兼容垫片;「连接与证书」新增连接体检与代理侧计数 |
|
|
156
160
|
| **`0.3.6`** | **`0.1.7-rc.2`**、`0.1.7-rc.1` | 远程也能添加工作区:浏览器侧遮蔽官方目录流程(本机仍走系统对话框,远程改用页面内目录浏览器,可在弹层内解锁);修掉代理双向丢弃插件管理 cookie 导致 `password_unlock` 对远程形同虚设;补上一直缺失的「远程设备管理权限」控件;「已保存」改为右上角提示;状态表面配色按实测重做;弹层两行被压扁重叠 |
|
|
157
161
|
| **`0.3.5`** | **`0.1.7-rc.2`**、`0.1.7-rc.1` | 连接层可见性:`http://` 访问 TLS 端口由「空白页 + 无日志」改为 301 跳 `https` 并记日志;删除设备记录后旧 cookie 不再把浏览器锁死(吊销/拉黑仍拒绝);移除页文案同步修正 |
|
package/lib/index.js
CHANGED
|
@@ -3214,7 +3214,7 @@ const MOBILE_SCROLL_MARKER = "/*dsh-lan-guard:mobile-scroll*/";
|
|
|
3214
3214
|
* @returns one inline `<script>` element.
|
|
3215
3215
|
*/
|
|
3216
3216
|
function mobileScrollFixScript() {
|
|
3217
|
-
return `<script>${MOBILE_SCROLL_MARKER}(function(){try{var diag=/[?&]lgdiag/.test(self.location.search);var out=[];function log(s){out.push(s);if(diag)draw()}function draw(){try{var p=document.getElementById("lgsc");if(!p){p=document.createElement("pre");p.id="lgsc";p.style.cssText="position:fixed;left:0;top:0;right:0;height:46%;z-index:2147483647;background:rgba(0,0,0,.92);color:#0f0;font:10px/1.3 monospace;padding:6px;margin:0;overflow:auto;white-space:pre-wrap;pointer-events:none";(document.body||document.documentElement).appendChild(p)}p.textContent="[lan-guard 手机滚动诊断]"+String.fromCharCode(10)+out.join(String.fromCharCode(10))}catch(e){}}var touched=[];function set(el,prop,val){if(!el)return;try{el.style.setProperty(prop,val,"important");touched.push([el,prop])}catch(e){}}function undoAll(){for(var i=0;i<touched.length;i++){try{touched[i][0].style.removeProperty(touched[i][1])}catch(e){}}touched=[]}function conv(){try{return document.querySelector("[data-conversation-scroll]")}catch(e){return null}}function convScrolls(){var c=conv();return !!c&&c.scrollHeight>c.clientHeight+8}function pageScrolls(){var d=document.documentElement,b=document.body;return (d&&d.scrollHeight>d.clientHeight+8)||(b&&b.scrollHeight>b.clientHeight+8)}function clipping(){var r=[];var all=document.querySelectorAll("div");var lim=Math.min(all.length,5000);for(var i=0;i<lim;i++){var el=all[i];var cs=getComputedStyle(el);if(cs.overflowY!=="hidden"&&cs.overflowY!=="clip")continue;if(el.clientHeight<150)continue;if(el.scrollHeight<=el.clientHeight+8)continue;r.push(el)}r.sort(function(a,b){return (b.scrollHeight-b.clientHeight)-(a.scrollHeight-a.clientHeight)});return r}function overlayOpen(){try{if(document.querySelector("[aria-modal=true],[role=dialog],[data-conversation-overlay]"))return true;var el=document.elementFromPoint(Math.round(innerWidth*0.92),Math.round(innerHeight*0.45));while(el&&el!==document.body){var cs=getComputedStyle(el);if((cs.position==="fixed"||cs.position==="absolute")&&cs.pointerEvents!=="none"){var r=el.getBoundingClientRect();if(r.width>innerWidth*0.85&&r.height>innerHeight*0.7)return true}el=el.parentElement}}catch(e){}return false}function touchPassThrough(){var layers=document.querySelectorAll("div");var lim=Math.min(layers.length,5000);var n=0;for(var i=0;i<lim;i++){var el=layers[i];var cs=getComputedStyle(el);if(cs.position!=="fixed"&&cs.position!=="absolute")continue;if(cs.pointerEvents==="none")continue;var r=el.getBoundingClientRect();if(r.width<innerWidth*0.9||r.height<innerHeight*0.8)continue;if(el.querySelector("button,input,textarea,select,[contenteditable]"))continue;if((el.textContent||"").length>40)continue;el.style.setProperty("pointer-events","none","important");n++}log("touch passthrough layers="+n);return n}function fixClip(){var c=conv();if(!c)return false;var list=clipping();var before=c.scrollHeight-c.clientHeight;var n=0;for(var i=0;i<list.length;i++){if(!c.contains(list[i]))continue;set(list[i],"height","auto");set(list[i],"overflow","visible");n++}if(!n)return false;var after=c.scrollHeight-c.clientHeight;log("clip grow layers="+n+" max "+before+"->"+after);if(after<=before+8){undoAll();log("clip grow ineffective -> reverted");return false}return true}function fix(){if(convScrolls()){log("official scroll layer works; done");return true}var list=clipping();var clip=list[0];log("clipping="+list.length+(clip?(" first="+String(typeof clip.className==="string"?clip.className:"")+" "+clip.clientHeight+"/"+clip.scrollHeight):""));var root=document.getElementById("root");set(document.documentElement,"height","100%");set(document.body,"height","100%");set(document.body,"overflow","hidden");set(root,"height","100dvh");set(root,"min-height","0");set(root,"overflow","hidden");var n=clip,d=0;while(n&&n!==document.body&&d<8){var cs=getComputedStyle(n);if(cs.display.indexOf("flex")>=0||cs.display.indexOf("grid")>=0)set(n,"min-height","0");n=n.parentElement;d++}var ok=convScrolls();log("chainFix convScroll="+(conv()?(conv().clientHeight+"/"+conv().scrollHeight):"n/a")+" scrollable="+ok);if(!ok){undoAll();log("ineffective -> reverted (stock page)")}return ok}var done=false,tries=0;function run(){if(done)return;var narrow=self.matchMedia?self.matchMedia("(max-width: 1023px)").matches:false;var mobile=/iPhone|iPad|iPod|Android/i.test(navigator.userAgent||"");log("narrow="+narrow+" mobile="+mobile+" innerH="+innerHeight+" vv="+(self.visualViewport?self.visualViewport.height:"-")+" pageScrolls="+pageScrolls());if(!narrow||!mobile){done=true;return}if(overlayOpen()){undoAll();log("overlay/dialog open -> reverted");return}touchPassThrough();if(fixClip()){log("clip released -> max="+(conv().scrollHeight-conv().clientHeight));done=true;return}if(convScrolls()){log("official scroll layer
|
|
3217
|
+
return `<script>${MOBILE_SCROLL_MARKER}(function(){try{var diag=/[?&]lgdiag/.test(self.location.search);var out=[];function log(s){out.push(s);if(diag)draw()}function draw(){try{var p=document.getElementById("lgsc");if(!p){p=document.createElement("pre");p.id="lgsc";p.style.cssText="position:fixed;left:0;top:0;right:0;height:46%;z-index:2147483647;background:rgba(0,0,0,.92);color:#0f0;font:10px/1.3 monospace;padding:6px;margin:0;overflow:auto;white-space:pre-wrap;pointer-events:none";(document.body||document.documentElement).appendChild(p)}p.textContent="[lan-guard 手机滚动诊断]"+String.fromCharCode(10)+out.join(String.fromCharCode(10))}catch(e){}}var touched=[];function set(el,prop,val){if(!el)return;try{el.style.setProperty(prop,val,"important");touched.push([el,prop])}catch(e){}}function undoAll(){for(var i=0;i<touched.length;i++){try{touched[i][0].style.removeProperty(touched[i][1])}catch(e){}}touched=[]}function conv(){try{return document.querySelector("[data-conversation-scroll]")}catch(e){return null}}function convScrolls(){var c=conv();return !!c&&c.scrollHeight>c.clientHeight+8}function pageScrolls(){var d=document.documentElement,b=document.body;return (d&&d.scrollHeight>d.clientHeight+8)||(b&&b.scrollHeight>b.clientHeight+8)}function clipping(){var r=[];var all=document.querySelectorAll("div");var lim=Math.min(all.length,5000);for(var i=0;i<lim;i++){var el=all[i];var cs=getComputedStyle(el);if(cs.overflowY!=="hidden"&&cs.overflowY!=="clip")continue;if(el.clientHeight<150)continue;if(el.scrollHeight<=el.clientHeight+8)continue;r.push(el)}r.sort(function(a,b){return (b.scrollHeight-b.clientHeight)-(a.scrollHeight-a.clientHeight)});return r}function overlayOpen(){try{if(document.querySelector("[aria-modal=true],[role=dialog],[data-conversation-overlay]"))return true;var el=document.elementFromPoint(Math.round(innerWidth*0.92),Math.round(innerHeight*0.45));while(el&&el!==document.body){var cs=getComputedStyle(el);if((cs.position==="fixed"||cs.position==="absolute")&&cs.pointerEvents!=="none"){var r=el.getBoundingClientRect();if(r.width>innerWidth*0.85&&r.height>innerHeight*0.7)return true}el=el.parentElement}}catch(e){}return false}function touchPassThrough(){var layers=document.querySelectorAll("div");var lim=Math.min(layers.length,5000);var n=0;for(var i=0;i<lim;i++){var el=layers[i];var cs=getComputedStyle(el);if(cs.position!=="fixed"&&cs.position!=="absolute")continue;if(cs.pointerEvents==="none")continue;var r=el.getBoundingClientRect();if(r.width<innerWidth*0.9||r.height<innerHeight*0.8)continue;if(el.querySelector("button,input,textarea,select,[contenteditable]"))continue;if((el.textContent||"").length>40)continue;el.style.setProperty("pointer-events","none","important");n++}log("touch passthrough layers="+n);return n}function fixClip(){var c=conv();if(!c)return false;var list=clipping();var before=c.scrollHeight-c.clientHeight;var n=0;for(var i=0;i<list.length;i++){if(!c.contains(list[i]))continue;set(list[i],"height","auto");set(list[i],"overflow","visible");n++}if(!n)return false;var after=c.scrollHeight-c.clientHeight;log("clip grow layers="+n+" max "+before+"->"+after);if(after<=before+8){undoAll();log("clip grow ineffective -> reverted");return false}return true}function fix(){if(convScrolls()){log("official scroll layer works; done");return true}var list=clipping();var clip=list[0];log("clipping="+list.length+(clip?(" first="+String(typeof clip.className==="string"?clip.className:"")+" "+clip.clientHeight+"/"+clip.scrollHeight):""));var root=document.getElementById("root");set(document.documentElement,"height","100%");set(document.body,"height","100%");set(document.body,"overflow","hidden");set(root,"height","100dvh");set(root,"min-height","0");set(root,"overflow","hidden");var n=clip,d=0;while(n&&n!==document.body&&d<8){var cs=getComputedStyle(n);if(cs.display.indexOf("flex")>=0||cs.display.indexOf("grid")>=0)set(n,"min-height","0");n=n.parentElement;d++}var ok=convScrolls();log("chainFix convScroll="+(conv()?(conv().clientHeight+"/"+conv().scrollHeight):"n/a")+" scrollable="+ok);if(!ok){undoAll();log("ineffective -> reverted (stock page)")}return ok}var done=false,tries=0;function run(){if(done)return;var narrow=self.matchMedia?self.matchMedia("(max-width: 1023px)").matches:false;var mobile=/iPhone|iPad|iPod|Android/i.test(navigator.userAgent||"");log("narrow="+narrow+" mobile="+mobile+" innerH="+innerHeight+" vv="+(self.visualViewport?self.visualViewport.height:"-")+" pageScrolls="+pageScrolls());if(!narrow||!mobile){done=true;return}if(overlayOpen()){undoAll();log("overlay/dialog open -> reverted");return}touchPassThrough();if(fixClip()){log("clip released -> max="+(conv().scrollHeight-conv().clientHeight));done=true;return}if(convScrolls()){log("official scroll layer works; waiting for late clip");return}if(fix())done=true}run();var t=setInterval(function(){tries++;run();if(done||tries>30)clearInterval(t)},1500);}catch(e){}})()<\/script>`;
|
|
3218
3218
|
}
|
|
3219
3219
|
/**
|
|
3220
3220
|
* Insert the narrow-screen scroll correction.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-lan-guard",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.5",
|
|
4
4
|
"description": "DSH web plugin: expose the official desktop Web UI to the local network through a gated reverse proxy, without touching DSH's own loopback binding.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|