Repository navigation
Background-Wallpaper-Engine
Trae 扩展 v0.2.3
中文
修复:切换主题后背景消失
workbench 在切换主题时会重建 body,背景 iframe 的文档虽然还挂在 DOM 里,但内部文档已经死了——过去只检查"元素还在不在",发现不了这种故障,表现为换完主题背景变黑且不再恢复。
这一版加了心跳自愈,每 4 秒做三件事:
workbench重排把 iframe 挤掉 → 重新挂回;- 给渲染页发
ping,用它是否回pong判断文档还活着; - 连续 12 秒没有回话 → 换一个
src重新加载。
同时处理了误判:窗口在后台时浏览器会节流定时器,恢复可见时重置计时,避免刚切回来就被判成"文档已死"。
其它:图标与 README 更新;package.json 版本 0.2.3。
- 安装包:
background-wallpaper-engine-0.2.3.vsix(410,966 字节) - SHA-256:
40fb97aa0700c987ec9a21cdb9cdd5f6458f3e2a27e3bf813247ffa7a324b665 - Open VSX:https://open-vsx.org/extension/tisakonicc/background-wallpaper-engine
安装:下载下方 vsix → 扩展面板右上角 ··· → 从 VSIX 安装 → 完全退出 IDE 再打开。
Trae CN 的扩展市场与 VS Code 官方市场都不收录本扩展,搜名字搜不到。
English
Fix: background disappeared after switching themes
When a theme is applied, workbench rebuilds body. The background iframe is still in the DOM but its document is already dead — the old check only verified the element existed, so it never noticed, leaving a black background that never came back.
This release adds heartbeat self-healing, every 4 seconds:
- if
workbenchreflowed the iframe away, re-attach it; - send a
pingto the rendered page and use thepongreply as proof the document is alive; - no reply for 12 consecutive seconds → replace
srcand reload.
False positives are handled too: background windows get their timers throttled, so the counter resets when the window becomes visible again.
Also: updated icon and README; package.json bumped to 0.2.3.
- Package:
background-wallpaper-engine-0.2.3.vsix(410,966 bytes) - SHA-256:
40fb97aa0700c987ec9a21cdb9cdd5f6458f3e2a27e3bf813247ffa7a324b665 - Open VSX: https://open-vsx.org/extension/tisakonicc/background-wallpaper-engine
Install: download the vsix below → Extensions panel ··· → Install from VSIX → fully quit and reopen the IDE.
Neither the Trae CN marketplace nor the Microsoft VS Code marketplace lists this extension; searching for its name will not find it.