Netflix Marathon

Automatically skip recaps, intros and click nexts on Netflix, DisneyPlus and Amazon video for you.

< Spätná väzba na Netflix Marathon

Otázka/komentár

§
Pridaný: 09.05.2021

Idea to shrink some code / less repetition.

// works for exact matches
['postplay-still-container', 'WatchNext-still-container', 'countdown', 'adSkipButton', 'skipElement']
    .forEach(className => {
        var elements = document.getElementsByClassName(className);
        if (elements.length !== 0) {
            elements[0].click();
            waitCount = 5;
            return;
        }
});

or if logging is important:

var logEnabled = true;
function log(thing) {
    logEnabled === true && console.log(thing);
}
const exactTargets = [
    ['postplay-still-container', 'Found autoplay.'],
    ['WatchNext-still-container', 'Found autoplay.'],
    ['countdown', 'Found Amazon video next.'],
    ['adSkipButton', 'Found Amazon skip ad.'],
    ['skipElement', 'Found Amazon skip intro.'],
]
exactTargets.forEach(target => {
    var className = target[0];
    var msg = target[1];
    var elements = document.getElementsByClassName(className);
    if (elements.length !== 0) {
        log(msg);
        elements[0].click();
        waitCount = 5;
        return;
    }
});
§
Pridaný: 09.05.2021

`waitCount` should be `count`

§
Pridaný: 10.05.2021
Upravený: 10.05.2021

@wOxxOm please delete this discussion. Thank you
I opened an updated and clean discussion at https://greasyfork.org/en/scripts/30029-netflix-marathon/discussions/86665

Pridať odpoveď

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