For those who would like to try the solution using Observer out of curiosity, although it seems not to be more performant nor work on pages where #movie_player is not present, here's the code:
consttarget=document.getElementById('movie_player');constconfig={childList:true,subtree:true};constcallback=function(mutationsList,observer){for(constmutationofmutationsList){if(mutation.addedNodes.length===0){return;}if(mutation.target.className!=="video-ads ytp-ad-module"){return;}// Look for Skip Button here :)}};constobserver=newMutationObserver(callback);observer.observe(target,config);
The solution needs some finishing where the comment is now. Take it as an exercise :)
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
For those who would like to try the solution using Observer out of curiosity, although it seems not to be more performant nor work on pages where
#movie_player
is not present, here's the code:The solution needs some finishing where the comment is now. Take it as an exercise :)