remove self

This commit is contained in:
MLH
2024-12-16 02:28:42 +01:00
parent b77c021722
commit a4a692b86e

View File

@ -74,7 +74,7 @@ function loadThemeCSS(cssPath) {
console.error(`Failed to load CSS: ${cssPath}`);
};
document.head.appendChild(link);
document.body.appendChild(link);
console.log(`CSS file "${cssPath}" loaded.`);
}
@ -104,6 +104,12 @@ function updateThemeContainer(containerClass) {
console.log(`Seasonals-Container class updated to "${containerClass}".`);
}
function removeSelf() {
const script = document.currentScript;
if (script) script.parentNode.removeChild(script);
console.log('External script removed:', script.src);
}
// initialize theme
function initializeTheme() {
let currentTheme;
@ -127,6 +133,8 @@ function initializeTheme() {
if (theme.js) loadThemeJS(theme.js);
console.log(`Theme "${currentTheme}" loaded.`);
removeSelf();
}