dsh-copy-fix
开发工具 活跃维护

dsh-copy-fix

lhh666-6/dsh-copy-fix

将剪贴板写入操作桥接到Electron主进程,修复桌面端复制按钮失效问题,无需额外配置即可正常使用复制功能,交互体验与应用原生逻辑保持一致。

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

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:

  1. Wraps navigator.clipboard.writeText.
  2. First tries the native browser write.
  3. Then POSTs the text to a plugin-owned loopback route.
  4. The Host side writes it through Electron's main-process clipboard.
  5. 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.