background changer 3

done, theme compatible + weird loading fix
This commit is contained in:
Guy Sandler committed 2026-02-10 22:08:52 -08:00
1 parent a7aea08668
commit 30ccf9db1d
4 files changed
+44 -25

No files matched your search

+6 -1
View File
@@ -391,7 +391,7 @@ function applyCustomBackground() {
if (options.customBackgroundLink && options.customBackgroundLink !== "") {
style.textContent = `
#not_right_side {
#wrapper {
background-image: url('${options.customBackgroundLink}') !important;
background-size: cover !important;
background-attachment: fixed !important;
@@ -408,6 +408,10 @@ function applyCustomBackground() {
document.documentElement.appendChild(style);
}
function clearCustomBackground() {
let style = document.querySelector("#bettercanvas-background");
if (style) style.remove();
}
let insertTimer;
function resetTimer() {
@@ -465,6 +469,7 @@ function recieveMessage(request, sender, sendResponse) {
case ("getcolors"): sendResponse(getCardColors()); break;
case ("inspect"): sendResponse(inspectDarkMode(true)); break;
case ("fixdm"): sendResponse(runDarkModeFixer(true)); break;
case ("updateBackground"): clearCustomBackground(); sendResponse(true); break;
default: sendResponse(true);
}
}