YouTube Mute and Skip Ads

Mutes, blurs and skips ads on YouTube. Speeds up ad playback. Clicks "yes" on "are you there?" on YouTube Music.

< Σχολιασμός για τον κώδικα YouTube Mute and Skip Ads

Ερώτηση/σχόλιο

§
Δημοσιεύτηκε: 23/03/2023

nice script, btw I also use SponsorBlock to stop Youtube ads

Since you made some Youtube scripts, I was wondering if you know how to detect page changes on YouTube. The problem I'm having is Youtube uses SPF code and usual userscript code like 'spfdone' or 'load' doesn't detect page loads. How do you deal with it?

ion1Δημιουργός
§
Δημοσιεύτηκε: 24/03/2023

Unfortunately there is no native event for the URL changing that I'm aware of. You could figure out an element which changes every time the YouTube page changes and use a MutationObserver. You could even use a hacky function which checks the URL for changes periodically. Or you could perhaps patch history.pushState and history.replaceState before the YouTube app loads and additionally watch for popstate events.

§
Δημοσιεύτηκε: 24/03/2023

I see, I tried some of those, it's so tricky... thx for the reply :)

ion1Δημιουργός
§
Δημοσιεύτηκε: 24/03/2023

np, good luck!

Δημοσίευση απάντησης

Συνδεθείτε για να δημοσιεύσετε μια απάντηση.