mirror of
https://gitlab.com/arnekeller/yt-addiction-control.git
synced 2024-11-23 00:45:00 +00:00
Fix CSS selectors
This commit is contained in:
parent
f32b631867
commit
468595da75
@ -12,7 +12,7 @@ let ytacCSS = {
|
|||||||
"endscreen": ".videowall-endscreen",
|
"endscreen": ".videowall-endscreen",
|
||||||
"invideo": ".ytp-ce-video",
|
"invideo": ".ytp-ce-video",
|
||||||
"notification": "ytd-notification-topbar-button-renderer",
|
"notification": "ytd-notification-topbar-button-renderer",
|
||||||
"other": "newness-dot, .ytp-spinner"
|
"other": "#newness-dot, .ytp-spinner"
|
||||||
};
|
};
|
||||||
|
|
||||||
const INVISIBLE = " { display: none !important; }"
|
const INVISIBLE = " { display: none !important; }"
|
||||||
@ -66,22 +66,18 @@ function modifyThings() {
|
|||||||
// autoplay disabler
|
// autoplay disabler
|
||||||
let autoplayButton = document.getElementById("toggle");
|
let autoplayButton = document.getElementById("toggle");
|
||||||
if (autoplayButton == null) {
|
if (autoplayButton == null) {
|
||||||
console.warn("[YTAC] could not locate autoplay button, trying again in 5s");
|
console.warn("[YTAC] could not locate autoplay button");
|
||||||
setTimeout(modifyThings, 5000);
|
|
||||||
repeating = true;
|
|
||||||
} else if (autoplayButton.getAttribute("aria-pressed") === "true") {
|
} else if (autoplayButton.getAttribute("aria-pressed") === "true") {
|
||||||
autoplayButton.click();
|
autoplayButton.click();
|
||||||
}
|
}
|
||||||
|
|
||||||
// description expander
|
// description expander
|
||||||
let showMoreButton = document.getElementById("more");
|
let showMoreButton = document.getElementsByClassName("more-button");
|
||||||
if (showMoreButton == null) {
|
if (showMoreButton.length == 0) {
|
||||||
console.warn("[YTAC] could not locate description expander, trying again in 5s");
|
console.warn("[YTAC] could not locate description expander, trying again in 5s");
|
||||||
if (!repeating) {
|
setTimeout(modifyThings, 5000);
|
||||||
setTimeout(modifyThings, 5000);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
showMoreButton.click();
|
showMoreButton[0].click();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
modifyThings();
|
modifyThings();
|
Loading…
Reference in New Issue
Block a user