diff --git a/youtube-addiction-control-extension-firefox.js b/youtube-addiction-control-extension-firefox.js index c3649b8..ca0aed1 100644 --- a/youtube-addiction-control-extension-firefox.js +++ b/youtube-addiction-control-extension-firefox.js @@ -79,26 +79,14 @@ browser.runtime.onMessage.addListener(window.ytacListener); console.log("[YTAC] added action listener"); 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 - /* - let showMoreButton = document.getElementsByClassName("more-button"); - if (showMoreButton.length == 0) { - console.warn("[YTAC] could not locate description expander, trying again in 5s"); - setTimeout(modifyThings, 5000); + let showMoreButton = document.querySelector(".ytd-video-secondary-info-renderer > #more"); + if (!showMoreButton) { + console.warn("[YTAC] could not locate description expander"); + //setTimeout(modifyThings, 5000); } else { - showMoreButton[0].click(); + showMoreButton.click(); } - */ } modifyThings();