Fix CSS selectors

This commit is contained in:
Arne Keller 2019-07-10 11:59:04 +02:00
parent f32b631867
commit 468595da75

View File

@ -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);
}
} else {
showMoreButton.click();
showMoreButton[0].click();
}
}
modifyThings();