dsh-web-compat
其他 活跃维护

dsh-web-compat

Visol-456/dsh-web-compat

轻量级Web兼容插件,可在非安全上下文环境下注入crypto.randomUUID polyfill补丁,解决局域网HTTP访问时附件上传崩溃问题,接入即用无需额外配置。

1
Stars 标星
0
Forks 分支
1
Watchers 关注
0
Open Issues
TypeScript
主要语言
MIT
开源协议
49 KB
仓库大小
1 个月前
最后推送
一键安装扩展 / 插件指令
dsh plugin --profile web add github:Visol-456/dsh-web-compat
git clone https://github.com/Visol-456/dsh-web-compat.git
git clone git@github.com:Visol-456/dsh-web-compat.git
README.md main

@visol-456/dsh-web-compat

DeepSeek Harness Web 兼容插件:修复通过局域网纯 HTTP(非 secure context)访问 dsh web 时,官方会话界面添加图片附件调用 crypto.randomUUID() 崩溃的问题,并在设置页新增「Web 兼容」状态面板。

原理

  • 浏览器仅在 secure context(HTTPS、localhost、127.0.0.1)暴露 crypto.randomUUID()。
  • 通过 http://192.168.3.2:3080 访问时属于非 secure context,crypto.randomUUID 为 undefined。
  • crypto.getRandomValues() 在非 secure context 仍可用,因此插件在 client bundle 模块顶层立即注入 UUID v4 polyfill。
  • 插件同时注册 Settings 新 section「Web 兼容」,显示当前是否 secure context 以及 randomUUID 来源。

使用

dsh plugin add @visol-456/dsh-web-compat

开发

npm install
npm test
npm run build

License

MIT