Repository navigation
fix(remote-access): 修复 iPadOS 16 上远程界面白屏(关联 #308) - #312
Merged
Merged
Conversation
The loader's tunnel and DSH's own client call Promise.withResolvers, AbortSignal.any and URL.canParse without checking for them, so on iOS 16 pairing succeeded but the interface stayed blank. The loader page and the preamble now install equivalents where the browser lacks them, ahead of every caller in both realms. check-web runs once more per engine with the three removed in every frame.
…nnect The Service Worker unpacks the computer's interface with DecompressionStream, which Safari has from iOS 16.4. Without it the interface stayed blank after pairing, while the computer showed the device as connected. The loader page now says the browser is too old before pairing or opening a computer. The READMEs and deployment guides state the minimum iOS / iPadOS version; check-web confirms the notice in both engines.
真机验证:iPadOS 16.6.1 上通过 ✅环境
结果修复前同一台 iPad:配对成功、电脑端显示已连接,iPad 整屏纯白。
构建产物旁证: 附注
结论 |
This was referenced Nov 14, 2026
Merged
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

关联 #308
问题与修改
#308:iPadOS 16.6.1 经中继配对成功,电脑上也显示已连接,但 iPad 上整屏白屏;同一中继下,iOS 18 的 iPhone 正常。
原因:远程网页和 DSH 0.2.2-rc.1 的网页端都直接调用了 iOS 16 上没有的三个内置方法:
Promise.withResolvers、AbortSignal.any(Safari 17.4 起提供)和URL.canParse(Safari 17 起提供)。fetch()和ping()用了Promise.withResolvers(src/protocol/tunnel.ts)。界面的每个请求都要经过这里,所以请求还没发到电脑就失败了。[Bug] 远程访问在iPadOS 16.6.1 从主屏幕打开远程页面整屏白屏 #308 里的分析指出的是这一处。dsh-api-gateway、会话控制、对话提交、审批和提问。也就是说,DSH 网页端实际要求 Safari 17.4,但没有写明。只改隧道的话,界面仍会在 DSH 自己的代码里报错、白屏(见下方验证)。union()和Set的新方法同名),或者调用前已经判断过。全部脚本都能按 ES2022 语法解析。修改:
src/web/fallbacks.ts:浏览器缺哪个方法,就用旧写法补一个等价实现;浏览器自带的不替换。加载页和注入 DSH 页面的预置脚本都最先导入它,所以 DSH 自己的脚本也能用上。DSH 的文件没有改动;电脑上的桌面端和本机网页端不加载这段代码。DecompressionStream。这类浏览器打开加载页时直接提示“此浏览器版本过低”,不再配对成功后白屏。验证
npm run check:类型检查、构建、83 个测试通过。新增的test/web/fallbacks.test.ts检查:缺少这三个方法时,补上的实现行为正确;浏览器自带的不会被替换。node scripts/check-web.ts(Chromium、WebKit):原有的三种部署都通过。每个内核新增两轮:DecompressionStream后,加载页只显示版本过低的提示,没有配对入口。Promise.withResolvers is not a function和AbortSignal.any is not a function,界面加载不出来。兼容性与后续事项
lib/web/loader.js和lib/web/preamble.js有变化,中继程序relay.js的构建结果不变。已部署的中继换上新构建(或升级到包含本修复的 npm 版本)即可生效,电脑端插件和桌面端不需要更新。AbortSignal.any和原生实现有一点不同:在任一来源中止之前,它一直被各来源的监听器引用。DSH 每处理一个电脑发来的请求会组合一次,连接断开时一起释放。这只发生在 iOS 17.4 以下。fallbacks.ts和两处导入即可。