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",
|
||||
"invideo": ".ytp-ce-video",
|
||||
"notification": "ytd-notification-topbar-button-renderer",
|
||||
"other": "newness-dot, .ytp-spinner"
|
||||
"other": "#newness-dot, .ytp-spinner"
|
||||
};
|
||||
|
||||
const INVISIBLE = " { display: none !important; }"
|
||||
@ -66,22 +66,18 @@ function modifyThings() {
|
||||
// autoplay disabler
|
||||
let autoplayButton = document.getElementById("toggle");
|
||||
if (autoplayButton == null) {
|
||||
console.warn("[YTAC] could not locate autoplay button, trying again in 5s");
|
||||
setTimeout(modifyThings, 5000);
|
||||
repeating = true;
|
||||
console.warn("[YTAC] could not locate autoplay button");
|
||||
} else if (autoplayButton.getAttribute("aria-pressed") === "true") {
|
||||
autoplayButton.click();
|
||||
}
|
||||
|
||||
// description expander
|
||||
let showMoreButton = document.getElementById("more");
|
||||
if (showMoreButton == null) {
|
||||
let showMoreButton = document.getElementsByClassName("more-button");
|
||||
if (showMoreButton.length == 0) {
|
||||
console.warn("[YTAC] could not locate description expander, trying again in 5s");
|
||||
if (!repeating) {
|
||||
setTimeout(modifyThings, 5000);
|
||||
}
|
||||
setTimeout(modifyThings, 5000);
|
||||
} else {
|
||||
showMoreButton.click();
|
||||
showMoreButton[0].click();
|
||||
}
|
||||
}
|
||||
modifyThings();
|
Loading…
Reference in New Issue
Block a user