mirror of
https://github.com/GuySandler/CanvasRefined.git
synced 2026-11-25 15:07:57 +01:00
background changer 3
done, theme compatible + weird loading fix
This commit is contained in:
1 parent
a7aea08668
commit
30ccf9db1d
4 files changed
+44
-25
No files matched your search
+6
-1
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user