Skip to content

Background-Wallpaper-Engine

Choose a tag to compare

@Tisakonicc Tisakonicc released this 12 Nov 09:12
· 5 commits to main since this release

Trae 扩展 v0.2.3

中文

修复:切换主题后背景消失

workbench 在切换主题时会重建 body,背景 iframe 的文档虽然还挂在 DOM 里,但内部文档已经死了——过去只检查"元素还在不在",发现不了这种故障,表现为换完主题背景变黑且不再恢复。

这一版加了心跳自愈,每 4 秒做三件事:

  1. workbench 重排把 iframe 挤掉 → 重新挂回;
  2. 给渲染页发 ping,用它是否回 pong 判断文档还活着;
  3. 连续 12 秒没有回话 → 换一个 src 重新加载。

同时处理了误判:窗口在后台时浏览器会节流定时器,恢复可见时重置计时,避免刚切回来就被判成"文档已死"。

其它:图标与 README 更新;package.json 版本 0.2.3。

安装:下载下方 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:

  1. if workbench reflowed the iframe away, re-attach it;
  2. send a ping to the rendered page and use the pong reply as proof the document is alive;
  3. no reply for 12 consecutive seconds → replace src and 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.

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.