feat: Update to version 1.2.0.0 with script injection improvements and fallback support

This commit is contained in:
CodeDevMLH
2025-12-17 16:34:02 +01:00
parent ca813bacb7
commit 4433cbb949
10 changed files with 142 additions and 20 deletions

View File

@@ -162,6 +162,7 @@ async function initializeTheme() {
automateThemeSelection = config.automateSeasonSelection;
defaultTheme = config.selectedSeason;
window.SeasonalsPluginConfig = config;
console.log('Seasonals Config loaded:', config);
} else {
console.error('Failed to fetch Seasonals config');
}
@@ -170,7 +171,7 @@ async function initializeTheme() {
}
let currentTheme;
if (!automateThemeSelection) {
if (automateThemeSelection === false) {
currentTheme = defaultTheme;
} else {
currentTheme = determineCurrentTheme();
@@ -178,7 +179,7 @@ async function initializeTheme() {
console.log(`Selected theme: ${currentTheme}`);
if (currentTheme === 'none') {
if (!currentTheme || currentTheme === 'none') {
console.log('No theme selected.');
removeSelf();
return;
@@ -200,8 +201,9 @@ async function initializeTheme() {
removeSelf();
}
//document.addEventListener('DOMContentLoaded', initializeTheme);
document.addEventListener('DOMContentLoaded', () => {
// Ensure DOM is ready before initializing
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', initializeTheme);
} else {
initializeTheme();
});
}