Last active
March 20, 2026 10:56
-
-
Save jonkpirateboy/58c00963273405b416f3ec443f455ffc to your computer and use it in GitHub Desktop.
Tampermonkey: YouTube Auto Skip Ads. Install Tampermonkey https://www.tampermonkey.net/ and add the script. Done.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ==UserScript== | |
| // @name YouTube Auto Skip Ads | |
| // @description Skips ads on YouTube | |
| // @namespace https://pirateboy.net | |
| // @version 1.1 | |
| // @author Jonk | |
| // @match https://www.youtube.com/* | |
| // @grant none | |
| // ==/UserScript== | |
| (function () { | |
| 'use strict'; | |
| function skipAds() { | |
| const video = document.querySelector('video'); | |
| if (video && document.querySelector('.ad-showing')) { | |
| video.currentTime = video.duration || 9999; | |
| } | |
| const skipBtn = document.querySelector('.ytp-ad-skip-button, .ytp-ad-skip-button-modern'); | |
| if (skipBtn) skipBtn.click(); | |
| } | |
| const observer = new MutationObserver(skipAds); | |
| observer.observe(document.body, { childList: true, subtree: true }); | |
| })(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment