remove self
This commit is contained in:
10
seasonals.js
10
seasonals.js
@ -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();
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user