Fix description expander

This commit is contained in:
Arne Keller 2021-02-10 11:39:30 +01:00
parent 772a77c7e2
commit 4e050b429f

View File

@ -79,26 +79,14 @@ browser.runtime.onMessage.addListener(window.ytacListener);
console.log("[YTAC] added action listener"); console.log("[YTAC] added action listener");
function modifyThings() { function modifyThings() {
//let repeating = false;
// autoplay disabler
let autoplayButton = document.getElementById("toggle");
if (autoplayButton == null) {
console.warn("[YTAC] could not locate autoplay button, trying again in 10s ...");
setTimeout(modifyThings, 10000);
} else if (autoplayButton.getAttribute("aria-pressed") === "true") {
autoplayButton.click();
}
// description expander // description expander
/* let showMoreButton = document.querySelector(".ytd-video-secondary-info-renderer > #more");
let showMoreButton = document.getElementsByClassName("more-button"); if (!showMoreButton) {
if (showMoreButton.length == 0) { console.warn("[YTAC] could not locate description expander");
console.warn("[YTAC] could not locate description expander, trying again in 5s"); //setTimeout(modifyThings, 5000);
setTimeout(modifyThings, 5000);
} else { } else {
showMoreButton[0].click(); showMoreButton.click();
} }
*/
} }
modifyThings(); modifyThings();