dsh-copy-fix
修复 DSH Desktop 桌面端复制按钮失效问题的兼容性插件。
AI 分析
核心用途是解决 Electron 沙箱环境下浏览器剪贴板 API 写入受阻的问题,确保复制按钮正常工作。适合在使用打包后的 DSH Desktop 客户端且遇到复制无反应的用户。
安裝
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:lhh666-6/dsh-copy-fix說明文件
閱讀完整 README ↗dsh-copy-fix
GitHub: https://github.com/lhh666-6/dsh-copy-fix
npm:
dsh-copy-fix
A profile plugin for DSH that makes the built-in copy buttons work inside the packaged DSH Desktop Electron app.
Why
The DSH Desktop renderer is sandboxed. In some environments the browser Clipboard API is rejected for programmatic writes, so every copy button appears to do nothing. This plugin:
- Wraps
navigator.clipboard.writeText. - First tries the native browser write.
- Then POSTs the text to a plugin-owned loopback route.
- The Host side writes it through Electron's main-process clipboard.
- Finally falls back to
document.execCommand('copy').
Install in a profile
# npm (recommended, prebuilt)
dsh plugin --profile desktop add dsh-copy-fix
dsh plugin --profile web add dsh-copy-fix
# or directly from GitHub
dsh plugin --profile desktop add github:lhh666-6/dsh-copy-fix
dsh plugin --profile web add github:lhh666-6/dsh-copy-fix
Then restart DSH Desktop.