Hey there! Why you didn't do your script like that?:
// ==UserScript==
// @name YouTube Fuck Autoplay
// @description Hey YouTube, I'm the one to say what I watch. Fuck you.
// @include https://www.youtube.com/*
// @version 2
// @grant none
// @noframes
// @namespace https://greasyfork.org/en/users/175405-anao9aaw/wtf2
// @license MIT
// ==/UserScript==
setInterval(function() {
var l = document.getElementsByClassName("ytp-button");
var l2 = Array.from(l).filter(e => {return e.dataset.tooltipTargetId == "ytp-autonav-toggle-button";});
console.log(`Seeing ${l2.length} elements: ${l2}`);
var e = l2[0];
console.log(e.title);
if (e.title.endsWith("on")) {
e.click();
console.log(e.title);
}
}, 30 * 1000); // 30 seconds
// Can't use setTimeout because apparently the UI doesn't work while the tab isn't active. Ugh!
Hey there! Why you didn't do your script like that?: