z827439974/dsh-background-plugin ↗★ 0
dsh-plugin-webui-bg
DSH WebUI background plugin: pick a local image as the webui background, overlaid with a theme-matched translucent mask so it never disturbs the UI. Persistence is browser-local (localStorage).
安装
此插件尚未提供可验证的 bundle,或兼容性检查未通过。请先阅读仓库说明。 阅读完整 README ↗
说明文档
阅读完整 README ↗dsh-plugin-webui-bg
A DeepSeek Harness (DSH) WebUI plugin: pick a local image as the WebUI background, overlaid with a translucent mask that matches the current theme (light / dark), so the image never disturbs the UI's readability.
Features
- A Background image row in Settings → General:
- Pick a local image (browser file picker), or use the built-in Sample image to try it instantly
- Images are downscaled (max edge 1920px) and re-encoded (WebP, JPEG fallback) before persistence
- Live preview thumbnail
- Enable / disable toggle
- Mask opacity slider (50%–100%, default 75%)
- Background blur slider (0–40px, default 0)
- One-click Remove background
- The mask color uses the theme token
--dsw-alias-bg-base, so it follows the light/dark theme automatically. - Both background layers are
pointer-events: nonefixed layers — they never block interaction. - Privacy: the image never leaves your browser. It is stored in
localStorage(keydsh.webui-bg); no network requests are made.
How it works
The DSH layout frame and its full-viewport children (body, sidebar column, conversation root, …) carry their own opaque backgrounds that would otherwise paint over the background layers. The plugin:
- Appends two fixed layers to
document.body: the image behind, the theme-colored mask in front (bothpointer-events: none). - Neutralizes every large fully-opaque "surface" container it finds under the layout frame (size heuristics, no hashed-class dependence), so the layers show through. Cards, buttons and bubbles keep their own backgrounds for readability.
- Skips overlay-like subtrees (modals, popovers, tooltips — anything
fixed/absoluteor with a positivez-index), so dialogs stay opaque. - Watches the DOM with a
MutationObserverand re-neutralizes on remounts; restores the original backgrounds when the background is disabled.
Persistence is browser-local on purpose: DSH's API gateway only exposes allowlisted settings namespaces to configuration clients, so a third-party namespace would be refused on the wire.