Greasy Fork is available in English.

Youtube: AutoPlay Next Right Away

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

< 腳本Youtube: AutoPlay Next Right Away的回應

評論:OK - script works, but has bugs

§
發表於:2022-07-02
編輯:2022-07-02

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

querySelectorAll because of [role=button]

§
發表於:2022-07-02
編輯:2022-07-02
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);
§
發表於:2022-07-02

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);

發表回覆

登入以回復