cicy-desktop 2.1.263 → 2.1.265

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cicy-desktop",
3
- "version": "2.1.263",
3
+ "version": "2.1.265",
4
4
  "description": "CiCy - AI-powered operating system browser",
5
5
  "main": "src/main.js",
6
6
  "bin": {
@@ -139,10 +139,10 @@
139
139
  "//optionalDependencies": "(2026-06 回调): mac/linux 改回 native cicy-code(:8008,colima 在 16G mac 上压垮内存)→ 重新内置 cicy-code-<plat> / cicy-mihomo-<plat>,localbin.fromBundle 零网络 seed(npm 仅作更新通道,带 npmmirror→npmjs 回退)。这些由 scripts/sync-runtime-deps.cjs 在 tag-push 时同步到最新版。npm 的 os/cpu 字段保证每个平台只装自己那份。Windows 仍走 docker(WSL :8009),它那份 cicy-code-windows 用不到但 bundle 着无害。",
140
140
  "optionalDependencies": {
141
141
  "electron": "41.0.3",
142
- "cicy-code-darwin-x64": "2.3.342",
143
- "cicy-code-darwin-arm64": "2.3.342",
144
- "cicy-code-linux-x64": "2.3.342",
145
- "cicy-code-linux-arm64": "2.3.342",
142
+ "cicy-code-darwin-x64": "2.3.374",
143
+ "cicy-code-darwin-arm64": "2.3.374",
144
+ "cicy-code-linux-x64": "2.3.374",
145
+ "cicy-code-linux-arm64": "2.3.374",
146
146
  "cicy-code-windows-x64": "2.3.193",
147
147
  "cicy-mihomo-darwin-x64": "1.10.4",
148
148
  "cicy-mihomo-darwin-arm64": "1.10.4",
@@ -99,6 +99,20 @@ class PanelCells {
99
99
  });
100
100
  const wc = view.webContents;
101
101
  try { view.setBackgroundColor("#ffffff"); } catch (e) {}
102
+ // Chromium uses a dark canvas for transparent/un-styled documents when the
103
+ // app theme is dark (for example a plain `Not Found` response). Keep real
104
+ // site backgrounds intact, but give transparent pages a white fallback.
105
+ wc.on("dom-ready", () => {
106
+ wc.executeJavaScript(`(() => {
107
+ const transparent = (el) => {
108
+ const c = getComputedStyle(el).backgroundColor;
109
+ return c === 'transparent' || /rgba\\([^)]*,\\s*0(?:\\.0+)?\\)$/.test(c);
110
+ };
111
+ if (transparent(document.documentElement) && transparent(document.body)) {
112
+ document.documentElement.style.backgroundColor = '#fff';
113
+ }
114
+ })()`).catch(() => {});
115
+ });
102
116
  try { wc.cicyAccountIdx = profileIdx; } catch (e) {}
103
117
  scrubUA(wc);
104
118
  try { require("../utils/context-menu-options").attachContextMenu(wc); } catch (e) {}
@@ -707,6 +707,19 @@
707
707
  // ("this browser may not be secure")。
708
708
  wv.setAttribute('useragent', navigator.userAgent.replace(/\s(CiCyDesktop|Electron)\/\S+/g, ''));
709
709
  wv.setAttribute('src', url);
710
+ // file:// dev fallback uses a real <webview> instead of PanelCells. Match
711
+ // the native BrowserView behavior for transparent/un-styled pages.
712
+ wv.addEventListener('dom-ready', () => {
713
+ wv.executeJavaScript(`(() => {
714
+ const transparent = (el) => {
715
+ const c = getComputedStyle(el).backgroundColor;
716
+ return c === 'transparent' || /rgba\\([^)]*,\\s*0(?:\\.0+)?\\)$/.test(c);
717
+ };
718
+ if (transparent(document.documentElement) && transparent(document.body)) {
719
+ document.documentElement.style.backgroundColor = '#fff';
720
+ }
721
+ })()`).catch(() => {});
722
+ });
710
723
  wv.addEventListener('did-start-loading', () => c.el.classList.add('loading'));
711
724
  wv.addEventListener('did-stop-loading', () => c.el.classList.remove('loading'));
712
725
  wv.addEventListener('did-navigate', (e) => syncUrl(leafId, e.url));
@@ -349,6 +349,21 @@ class TabManager {
349
349
  const wp = buildTabWebPreferences(this.accountIdx, this.partition, target, opts);
350
350
  const view = new BrowserView({ webPreferences: wp });
351
351
  const wc = view.webContents;
352
+ // Transparent/un-styled responses (for example a plain-text tunnel error)
353
+ // otherwise inherit Electron's dark canvas while keeping black default text.
354
+ // Only fill fully transparent documents; never override a site's own theme.
355
+ try { view.setBackgroundColor("#ffffff"); } catch (e) {}
356
+ wc.on("dom-ready", () => {
357
+ wc.executeJavaScript(`(() => {
358
+ const transparent = (el) => {
359
+ const c = getComputedStyle(el).backgroundColor;
360
+ return c === 'transparent' || /rgba\\([^)]*,\\s*0(?:\\.0+)?\\)$/.test(c);
361
+ };
362
+ if (transparent(document.documentElement) && transparent(document.body)) {
363
+ document.documentElement.style.backgroundColor = '#fff';
364
+ }
365
+ })()`).catch(() => {});
366
+ });
352
367
  const id = wc.id;
353
368
  // Tag the tab's webContents with its profile so anything holding just the wc
354
369
  // (context menu, window helpers) can resolve the REAL profile deterministically.