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.

< Feedback on YouTube Mute and Skip Ads

Question/comment

§
Posted: 2023-03-23

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?

ion1Author
§
Posted: 2023-03-24

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.

§
Posted: 2023-03-24

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

ion1Author
§
Posted: 2023-03-24

np, good luck!

Post reply

Sign in to post a reply.