dsh-refresh
其他 活跃维护

dsh-refresh

spidu-lee/dsh-refresh

支持F5、Ctrl+F5、Ctrl+Shift+R / Cmd+Shift+R快捷键组合,拦截浏览器原生刷新事件并重新触发,确保目标页面每次都执行完整重载,绕过缓存与前端路由干扰,提升开发调试流畅度。

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

dsh-refresh

简体中文 | English

Make F5, Ctrl+F5, and Ctrl+Shift+R / Cmd+Shift+R reliably
reload the DeepSeek Harness page.

DeepSeek Harness has no refresh button, and the browser's built-in reload
shortcuts are suppressed in some contexts. This plugin installs a keydown
listener that captures F5 and Ctrl+Shift+R (Cmd+Shift+R on macOS) and
calls location.reload() — Ctrl+F5 and Ctrl+Shift+R additionally bypass
the cache (location.reload(true)).

Why not Ctrl+R?

Ctrl+R / Cmd+R is not supported, and it cannot be fixed from a
page-level plugin. DeepSeek Harness registers Ctrl+R as its built-in
page.refresh shortcut, and it consumes the key at the Electron
before-input-event layer — calling preventDefault() before the keydown
event ever reaches the page. A window.addEventListener("keydown", …)
listener simply never sees it.

Use F5 (reload), Ctrl+F5 (hard reload), or Ctrl+Shift+R (hard
reload) instead. If you want Ctrl+R back, rebind the page.refresh shortcut
in DeepSeek Harness's keyboard-shortcut settings to a different key; then
Ctrl+R will flow through to the page again.

How it works

A minimal client-only plugin. It exports name, inject, and apply(ctx),
and uses ctx.effect to register a capturing keydown listener that is
automatically removed when the plugin run is disposed.

window.addEventListener("keydown", (ev) => {
  const isF5 = ev.key === "F5";
  const isHardReload = (ev.ctrlKey || ev.metaKey) && ev.shiftKey && (ev.key === "r" || ev.key === "R");
  if (!isF5 && !isHardReload) return;
  ev.preventDefault();
  ev.stopPropagation();
  (isF5 && (ev.ctrlKey || ev.metaKey)) || isHardReload ? location.reload(true) : location.reload();
}, { capture: true });

Install

From npm (recommended):

dsh plugin add dsh-refresh

Or from GitHub:

dsh plugin add spidu-lee/dsh-refresh

License

MIT