Skip to content

v0.7.5 — Chat DeepSeek 在 DSH 窗口内

Latest

Choose a tag to compare

@jaychang1989 jaychang1989 released this 30 Sep 02:09

点侧边栏「Chat DeepSeek」,官方 chat.deepseek.com 直接渲染在 DSH 窗口的中栏里——不重新实现聊天界面,模型选择、深度思考、智能搜索、历史记录、附件上传仍然都是官方那一套。

这一版能做什么

  • 真正的原生浏览器访客,不是 iframe:走桌面端 dshDesktop.browser 的租约通道(宿主只放行 src="about:blank#" 且 partition 匹配的那个 ),所以站点自己的 Content-Security-Policy: frame-ancestors 'none' 拦不住它。DSH 自带的侧栏浏览器用的就是这条通道。
  • 导航行与页面都是标准槽位:注册到 sidebar.panellist 与按同一个 id 关联的 main 槽位,行的位置、选中态与面板切换都由 shell 负责,插件不往别人的 DOM 里塞东西。
  • 登录态跨重启保留:宿主给访客的分区是进程内的,所以本插件自己搬运——页面的 localStorage 与页面 cookie 走页面侧,分区 cookie(含 HttpOnly)在宿主能拿到 Electron 时一并搬运。想退出登录就删掉 %USERPROFILE%\.dsh\dsh-webchat\session.json。
  • 切换面板不重载:访客只是被隐藏、从不被卸载。
  • 没有访客桥接的环境(纯 dsh web)自动降级为打开一个窗口。

安装

dsh plugin --profile desktop add @jaychang1989/dsh-webchat

也可以直接用下面附件里的 tarball:

dsh plugin --profile desktop add https://github.com/jaychang1989/dsh-webchat/releases/download/v0.7.5/jaychang1989-dsh-webchat-0.7.5.tgz

装完重启桌面端。npm 页面:https://www.npmjs.com/package/@jaychang1989/dsh-webchat

质量

  • 34 个用例(node --test),覆盖槽位注册契约、租约与 webview 约定、UA 顺序、访客生命周期、登录态快照与回灌、无 Electron 时的降级
  • 零运行时依赖,无构建步骤(React 取自浏览器的模块表,其余是手写 DOM)

Requirements / 环境要求

DeepSeek Harness 0.2.0-rc.1 或更新的 0.2.x · Node.js >= 22 · 桌面端(只有它提供原生访客桥接)


Click "Chat DeepSeek" in the sidebar and the official chat.deepseek.com page renders in the center column of the DSH desktop window, through the shell's approved native browser guest rather than an iframe. It stays signed in across restarts, keeps the guest mounted while you visit other panels, and falls back to opening a window where no guest bridge exists. Zero runtime dependencies, no build step, 34 tests.