dsh-window-state
Manifest validIn the DSH desktop client, select the startup window state (Default / Maximized / Fullscreen) from **Settings → General Settings**. Windows.
dsh-window-state
在 DSH 桌面客户端的 设置 → 通用设置 里增加一行「启动窗口状态」,可选择每次启动时窗口以 默认 / 最大化 / 全屏 打开(Windows)。
原理
DSH 桌面主窗口由 Electron 主进程创建,插件运行时(Host / Client)没有任何 IPC 或服务能触达 BrowserWindow 的 maximize / fullscreen(已反编译 app.asar 验证:唯一的窗口状态通道 dsh-desktop:window-fullscreen 是主进程→渲染进程的单向通知,且 main.js 里没有任何全屏/最大化入口)。
因此本插件走越界机制——通过 Win32 API(user32.dll)从子进程定位并控制窗口:
- 用
EnumWindows按窗口类Chrome_WidgetWin_1+ 标题含DeepSeek Harness定位主窗口(不能用进程 pid,因为 Host Node 进程与 Electron 主进程是不同 pid)。 ShowWindowAsync(hwnd, SW_MAXIMIZE / SW_RESTORE)实现最大化 / 还原。- 全屏:剥离
WS_CAPTION | WS_THICKFRAME样式 +SetWindowPos到全屏分辨率;退出时恢复样式并重新最大化。
选择持久化在 localStorage(dsh-window-state:startup),两条路径生效:
webserver/index-inject注入一段同步脚本,在启动最早时刻读取并应用选择。POST /dsh-window-state/apply在用户修改设置时立即应用。
局限
- 仅 Windows(依赖 PowerShell + Win32 API)。
- 全屏是通过剥离窗口边框实现的「伪全屏」,等价于
BrowserWindow.setFullScreen(true)的视觉效果(无系统标题栏、铺满整个显示器)。 - 依赖
powershell.exe与user32.dll,均为 Windows 自带组件。
安装
从 GitHub 安装(推荐,尚未发布到 npm):
github:gaoyian7251/dsh-window-state
在 DSH 的 设置 → 插件 → 安装 里填入上面的标识,或通过 CLI 安装到 profile:
dsh plugin install github:gaoyian7251/dsh-window-state
也可以直接把仓库克隆到 profile 的 node_modules 下。安装后需重启桌面客户端才生效(profile 的插件图在进程启动时构建)。
使用
重启后打开 设置 → 通用设置,找到「启动窗口状态」一行,选择 默认 / 最大化 / 全屏:
- 选择会立刻应用到当前窗口,并持久化,下次启动自动生效;
- 默认 = 保持 Electron 记住的上次窗口位置与大小。
常见问题
从本地路径装过之后,重装报 ERR_PNPM_EPERM ... rename ..._tmp_... -> ...dsh-window-state
用本地路径安装(dsh plugin install <本地目录>)时 pnpm 会建立一个 Junction 链接,而卸载时不会把它从 node_modules 里删掉;之后新版本无法 rename 落位,就会报 EPERM。清掉这个链接再装即可(rmdir 只删链接,不会动你的源码目录):
cmd /c rmdir "$env:USERPROFILE\.dsh\profiles\desktop\node_modules\dsh-window-state"
dsh plugin install github:gaoyian7251/dsh-window-state
从 git 安装的是真实目录,之后卸载 / 升级都不会再有这个问题。
⚠️ 只能用
cmd /c rmdir删这个链接。 不要用 PowerShell 的Remove-Item -Recurse:它会穿透 Junction 去删链接指向的目录 —— 也就是你的插件源码(曾因此把源码仓库的.git删坏)。
目录结构
lib/index.js Host 半(Win32 helper + webServer 路由 + index-inject)
lib/client.js Client 半(settings.general.item 行 + 分段控件)
cordis.patch.yml 挂载补丁
package.json 包清单(dsh.client / dsh.bundle.patch)
Comments
Loading…
Similar plugins
by MARIOMLY
Open the DeepSeek Harness Web UI as a standalone desktop app window (Chromium --app mode) — a DSH host plugin. / 把 DSH Web 界面变成独立桌面应用窗口的 DSH 插件。
★ 0
MIT
JavaScript
Sep 14, 2026
dsh plugin --profile web add dsh-desktop-appby fuyue521
Windows desktop shortcut for dsh web: launches the server, auto-opens the browser when ready, and stops the service when the Harness window closes.
★ 2
↓ 189/wk
MIT
JavaScript
Aug 18, 2026
dsh plugin --profile web add dsh-desktop-shortcutby harmless0819-dev
Close / restart DSH buttons in Settings > General, plus an opt-out auto-close that waits until every browser page has stopped beaconing.
★ 0
MIT
JavaScript
Sep 21, 2026
dsh plugin --profile web add dsh-power-controlsby StabCut
DSH Desktop sidebar restart button: orderly relaunch of DSH Desktop from the sidebar settings row (based on desktopActions.requestRestart).
★ 0
MIT
JavaScript
Aug 21, 2026
dsh plugin --profile web add dsh-plugin-restart-desktopby y2zyyr
@y2zyyr/dsh-restart-button — one-click Restart DSH button in Settings → General (DSH Desktop), using the official desktopRuntime.requestRestart() facade.
★ 0
MIT
JavaScript
Aug 22, 2026
dsh plugin --profile web add @y2zyyr/dsh-restart-controlby Fyue7
给 DSH 会话头部加一颗重启按钮:完全退出并把新实例拉回来,全程零窗口。非官方插件。
★ 0
JavaScript
Oct 10, 2026
dsh plugin --profile web add dsh-restart-button