Youtube: AutoPlay Next Right Away

Play next video within 1 second of the end of a video.

< Spätná väzba na Youtube: AutoPlay Next Right Away

Hodnotenie: OK - skript funguje, ale má chyby

§
Pridaný: 02.07.2022
Upravený: 02.07.2022

try fix with:
document.querySelectorAll('[class*="endscreen"][class*="button"]:not([style="display: none;"]) a[role=button]')[0];
work fine.

querySelectorAll because of [role=button]

§
Pridaný: 02.07.2022
Upravený: 02.07.2022
var autoPlayNextRightAway = setInterval(function() {
    var e = document.querySelectorAll('[class*="endscreen"][class*="button"]:not([style="display: none;"]) a[role=button]')[0];
    if (e) {
        e.click();
        autoPlayNextRightAway && clearInterval(autoPlayNextRightAway);
    }
}, 100);
§
Pridaný: 02.07.2022

OUUPS!!
BAD TYPING.
HERE IS THE GOOD CODE.

autoPlayNextRightAway && clearInterval(autoPlayNextRightAway);

var autoPlayNextRightAway = setInterval(function() {
    var e = document.querySelectorAll('[class*="endscreen"][class*="button"]:not([style="display: none;"]) a[role=button]')[0];
    if (e) {
        e.click();
    }
}, 100);

Pridať odpoveď

Aby ste mohli pridať odpoveď, prihláste sa.