From 179c81a15654fb5328e3ae81b8b26ae9b76e35fb Mon Sep 17 00:00:00 2001 From: Jordan Wages Date: Tue, 8 Jul 2025 01:46:54 -0500 Subject: [PATCH] Fix menu icons for dark theme --- background.js | 13 +++++++++++++ manifest.json | 3 ++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/background.js b/background.js index fcccc6b..9084c8c 100644 --- a/background.js +++ b/background.js @@ -377,6 +377,19 @@ async function clearCacheForMessages(idsInput) { refreshMenuIcons(); } }); + + if (browser.theme?.onUpdated) { + browser.theme.onUpdated.addListener(async () => { + if (userTheme === 'auto') { + const theme = await detectSystemTheme(); + if (theme !== currentTheme) { + currentTheme = theme; + updateActionIcon(); + refreshMenuIcons(); + } + } + }); + } } catch (err) { logger.aiLog("failed to load config", { level: 'error' }, err); } diff --git a/manifest.json b/manifest.json index d44fd1d..0cbfb13 100644 --- a/manifest.json +++ b/manifest.json @@ -41,6 +41,7 @@ "accountsRead", "menus", "scripting", - "tabs" + "tabs", + "theme" ] }