All plugins

DSH / BUNDLE / CLIENT-UI

dsh-external-links

v0.2.0Lion-Li-git / dsh-external-links9e5543f9c5

InstallableBundlesUI & client pluginsCommunity · Topic auto-analysisWeb UI

Overview

dsh-external-links

DSH 桌面端外部链接修复:点击 http/https 链接自动在系统默认浏览器打开。补上壳层缺失的 webview 链接点击接线,直连已修复的原生桥 shell.open-external(DSH 桌面端 5.3.6+,Windows 版)。

README / EN

Package documentation

dsh-external-links

DSH 桌面端(Deepseek Harness EAC,Windows WebView2 壳)外部链接修复插件。

点击应用里的 http/https 外链时,自动在系统默认浏览器中打开,而不是毫无反应。

为什么还需要它(v0.2.0)

  • DSH 桌面端 5.3.6 已修复壳层 shell.open-external 桥接(PR #251:cmd startShellExecuteW,实测返回 {ok:true})。
  • 但壳层只修好了"被调用时的打开动作",webview 里点击 <a target="_blank"> 外链 仍没有原生接线(壳注入的 BRIDGE_JS 与 webui 框架都没有锚点点击拦截)—— 实测 5.3.6 停用本插件后点链接依旧打不开。
  • 本插件补上这层缺失的"接线":拦截链接点击后直连已修复的原生桥
点击链接 / window.open()
   ↓(客户端拦截器,capture 阶段)
window.dshDesktop.openExternal(url)     → 原生 ShellExecuteW → 默认浏览器
window.dshDesktop.openPath(path)        → file:// 解码为路径后默认应用打开

功能

  • http:// / https:// → 默认浏览器(原生桥,5.3.6+);
  • file:// → 解码为 Windows 绝对路径 → openPath 默认应用打开;
  • 应用内链(同源、127.0.0.1/localhost#hash、下载、javascript:不受影响
  • 右键复制、中键点击不被破坏;
  • 无壳层(普通浏览器直接打开 webui)→ 自动回退 window.open 新标签页;
  • v0.2.0 起无宿主路由:不再依赖 PowerShell / webServer(上游已修复的部分已去掉)。

安装

方式 A:cordis.patch.yml 直装(推荐 —— 可在「插件管理」里开关)

~/.dsh/profiles/web-desktop/package.jsondependencies 中加入:

"dsh-external-links": "github:Lion-Li-git/dsh-external-links"

执行 pnpm install,并在该目录 cordis.patch.yml 末尾追加:

- insert:
    - id: dsh-external-links
      name: 'dsh-external-links'

重启 DSH 桌面端。之后插件会像内置插件一样出现在设置 → 插件 列表,可直接开关 (停用 = 写入 disabled: true,下次启动不再加载)。

方式 B:bundle 安装(dsh plugin add,快捷但不可在插件管理页开关)

dsh plugin --profile web-desktop add github:Lion-Li-git/dsh-external-links

说明:bundle 方式(dsh.profile.bundles)安装的第三方插件,当前官方版本 在插件管理页不支持停用/移除(会提示"请在插件市场卸载")——这是上游对 所有市场/bundle 插件的一致限制,不是本插件的特例。想用开关就选方式 A。

验证

  • 重启后打开任意会话,点击消息里的外链 → 应在默认浏览器打开;
  • 应用内导航、设置页、下载等不受影响;
  • 停用插件后重启,链接会回到"点了没反应"(说明确实由本插件接线)。

版本历史

  • 0.1.0:壳层桥接损坏期方案 —— 自带 PowerShell 宿主路由(Start-Process)绕开 cmd start bug。
  • 0.2.0:适配 5.3.6 —— 桥接已修复,去掉宿主路由,改为直连 shell.open-external

兼容性

  • 目标:DSH 桌面端 ≥ 5.3.6 Windows 版(dsh-eac-shell.exe);
  • 5.3.6 之前的版本请用 0.1.0(原生桥在那之前是坏的);
  • 纯客户端实现,无框架依赖、无需 PowerShell;
  • 插件装在用户 profile~/.dsh),DSH 桌面端版本更新不会覆盖它。

License

MIT