Last active
November 25, 2020 14:34
-
-
Save Frondor/8a21db963ba72e7a3266279314b55281 to your computer and use it in GitHub Desktop.
Abrir una playlist > copypastear en Chrome Dev Tools > Sources > new Snippet y darle plaaay
This file contains 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
(($adsContainer, skipBtnClass, addOverlayClass) => { | |
const handler = (mutationsList, observer) => { | |
mutationsList.some((mutation) => { | |
if (mutation.type !== 'childList') return; | |
const $btn = $adsContainer.querySelector(skipBtnClass); | |
if ($btn) { | |
$btn.click(); | |
return true; | |
} | |
const $addOverlay = $adsContainer.querySelector(addOverlayClass); | |
if ($addOverlay) { | |
$addOverlay.remove(); | |
return true; | |
} | |
}); | |
}; | |
const observer = new MutationObserver(handler); | |
observer.observe($adsContainer, { | |
childList: true, | |
subtree: true, | |
}); | |
})($('.video-ads.ytp-ad-module'), '.ytp-ad-skip-button-slot', '.ytp-ad-overlay-slot'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment