diff --git a/browser/base/content/browser-compacttheme.js b/browser/base/content/browser-compacttheme.js index 99abc39f7448..8e3d8c94b8e0 100644 --- a/browser/base/content/browser-compacttheme.js +++ b/browser/base/content/browser-compacttheme.js @@ -22,7 +22,7 @@ var CompactTheme = { }, get isThemeCurrentlyApplied() { - let theme = LightweightThemeManager.currentTheme; + let theme = LightweightThemeManager.currentThemeForDisplay; return theme && ( theme.id == "firefox-compact-dark@mozilla.org" || theme.id == "firefox-compact-light@mozilla.org"); diff --git a/toolkit/mozapps/extensions/LightweightThemeManager.jsm b/toolkit/mozapps/extensions/LightweightThemeManager.jsm index 000a82a45b50..16fb080b9826 100644 --- a/toolkit/mozapps/extensions/LightweightThemeManager.jsm +++ b/toolkit/mozapps/extensions/LightweightThemeManager.jsm @@ -140,8 +140,15 @@ var LightweightThemeManager = { get currentThemeForDisplay() { var data = this.currentTheme; - if ((!data || data.id == DEFAULT_THEME_ID) && _fallbackThemeData) - data = _fallbackThemeData; + + if (!data || data.id == DEFAULT_THEME_ID) { + if (_fallbackThemeData) { + return _fallbackThemeData; + } + if (_defaultThemeIsInDarkMode) { + return this.getUsedTheme(DARK_THEME_ID); + } + } if (data && PERSIST_ENABLED) { for (let key in PERSIST_FILES) {