• 1 Post
  • 2 Comments
Joined 1 year ago
cake
Cake day: July 28th, 2023

help-circle

  • I’m going to start a discussion in the comments here about methods to bypass the message. I will add suggestions here, so leave comments if you find a method!

    Methods to bypass Youtube Anti-Adblock:

    • The easiest method is simply to comply and turn off your adblock extension.

    My Method

    • My method, and the one that will likely work universally is as follows:

    Install Extension Enhancer for YouTube™

    Go to the extensions settings and ensure that under the Ads Management section, “Block Ads” is turned OFF

    Now find the Custom Script box at the very bottom and enter the following script. I did not write this code, it comes from egaudette on GitHub

    (function() {
        'use strict';
        var clickInterval = setInterval(skipAds, 5);
        var ytpAdModule;
        var miniAdd;
        var skipButton;
        var currentVideo;
    
        function skipAds() {
            ytpAdModule = document.querySelector('.ytp-ad-module');
            skipButton = document.querySelector('button[class*="ad-skip"]');
            miniAdd = document.querySelector('.ytp-ad-overlay-container');
    
            if (ytpAdModule !== null && ytpAdModule.innerHTML !== '') {
                ytpAdModule.style.display = 'none';
            }
    
            if (skipButton !== null) {
                skipButton.click();
                return;
            }
    
            currentVideo = document.querySelector('video[class*="main-video"]')
            if (currentVideo !== null && currentVideo.duration <= 5) {
                currentVideo.muted = true;
                currentVideo.play();
                currentVideo.currentTime = currentVideo.duration;
            }
        }
    })();
    

    Lastly, ensure the “Automatically execute the script when YouTube is loaded in a tab” box is checked, and press Save


    I’ll add more methods as they are discovered!