From ce5bb5f187669cdefcde016d666789b38b7e542a Mon Sep 17 00:00:00 2001 From: kuaifan Date: Wed, 14 Jan 2026 10:14:31 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E7=BB=9F=E4=B8=80=20webTab=20?= =?UTF-8?q?=E8=83=8C=E6=99=AF=E8=89=B2=E8=AE=BE=E7=BD=AE=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 移除 createWebTabView 中冗余的深色/浅色主题背景色判断分支 - 统一使用 utils.getDefaultBackgroundColor() 获取默认背景色 - 移除 did-stop-loading 事件中不必要的背景色重置逻辑 --- electron/lib/web-tab-manager.js | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/electron/lib/web-tab-manager.js b/electron/lib/web-tab-manager.js index 94179d76f..4b7eee245 100644 --- a/electron/lib/web-tab-manager.js +++ b/electron/lib/web-tab-manager.js @@ -680,12 +680,8 @@ function createWebTabView(windowId, args) { if (args.backgroundColor) { browserView.setBackgroundColor(args.backgroundColor) - } else if (isWindowMode) { - browserView.setBackgroundColor(utils.getDefaultBackgroundColor()) - } else if (nativeTheme.shouldUseDarkColors) { - browserView.setBackgroundColor('#575757') } else { - browserView.setBackgroundColor('#FFFFFF') + browserView.setBackgroundColor(utils.getDefaultBackgroundColor()) } browserView.setBounds({ @@ -852,9 +848,6 @@ function createWebTabView(windowId, args) { }) browserView.webContents.on('did-stop-loading', _ => { stopLoading() - if (nativeTheme.shouldUseDarkColors) { - browserView.setBackgroundColor('#FFFFFF') - } }) browserView.webContents.on('before-input-event', (event, input) => { // 使用动态窗口ID,支持标签在窗口间转移