Recently, I created a tampermokey script that keeps track of the i
intervals and automatically clicks on the next video. However, it's quite strange that the script only works properly when the alert
line is uncommented:
var i = 1;
setInterval(function () {
document.getElementsByClassName('PlaylistVideo')[i].click();
// alert("i is equal to: "+ i);
i ++
}, 5000);