Ad-blocking has become a contentious topic in the world of online content consumption. While many users rely on ad blockers to enhance their web experience, it's important to note that this practice can sometimes violate the Terms of Service of certain platforms. One such platform is YouTube, which occasionally displays a nagging popup message when it detects the presence of an ad blocker. This popup message can disrupt your viewing experience and leave you feeling frustrated.

This is where the "YouTube Ad Blocker Popup Removal" Chrome extension comes to the rescue. Developed by Saurav Hathi, this extension not only removes the annoying YouTube ad blocker popup but also adds a "Donate" button to the video owner's profile, making it a win-win for both viewers and creators.

Getting Rid of the YouTube Ad Blocker Popup

The Chrome extension operates seamlessly in the background and is simple to install. Here's how you can do it:

1. Installation: Start by navigating to the https://github.com/sauravhathi/youtube-ad-blocker-popup-removal. You can download the extension from the "Releases" section.

2. Adding to Chrome: Once downloaded, go to Chrome and open the "Extensions" page. You can access this page by clicking on the three dots in the top-right corner of your browser, selecting "More tools," and then clicking "Extensions."

3. Enabling Developer Mode: In the "Extensions" page, enable "Developer mode" by toggling the switch in the top-right corner.

4. Loading the Extension: After enabling developer mode, you'll see an option to "Load unpacked." Click on it and navigate to the folder where you downloaded the extension. Select the folder and click "Open."

5. Activation: You should now see the "YouTube Ad Blocker Popup Removal" extension among your installed extensions. Ensure it is enabled.

With these simple steps, you've successfully added the extension to your Chrome browser, and it will automatically start doing its job of removing the YouTube ad blocker popup.

content.js

console.log('👨‍💻 Author: Saurav Hathi \n🌟 GitHub: https://github.com/sauravhathi \n🚀Linkedin: https://www.linkedin.com/in/sauravhathi');

/**
 * Watches for the presence of a YouTube ad blocker popup and removes it.
 * Also adds a "Donate" button to the video owner's profile.
 */
function watchForElement() {
  const backdropSelector = "tp-yt-iron-overlay-backdrop.opened";
  const dialogSelector = "tp-yt-paper-dialog";
  const playButtonSelector = ".ytp-play-button.ytp-button";

  const donateBtn = document.createElement("button");
  donateBtn.innerHTML = "Donate";
  donateBtn.classList.add("donate-btn");
  donateBtn.addEventListener("click", () => {
    window.open("https://github.com/sauravhathi/youtube-ad-blocker-popup-removal#support-the-developer");
  });

  const observer = new MutationObserver(function (mutations) {
    const backdrop = document.querySelector(backdropSelector);
    const dialog = document.querySelector(dialogSelector);
    const playButton = document.querySelector(playButtonSelector);
    const p = document.querySelector("div#owner");

    // If the backdrop and dialog exist, remove them.
    if (backdrop) {
      backdrop.remove();
    }

    // If the dialog exists, remove it and click the play button.
    if (dialog) {
      dialog.remove();
      if (playButton) {
        playButton.click();
      }
      if (p) {
        // Add the donate button to the video owner's profile.
        p.appendChild(donateBtn);
      }
      observer.disconnect();
    }

  });

  observer.observe(document, { childList: true, subtree: true });
}

watchForElement();

manifest.json

{
  "manifest_version": 3,
  "name": "Youtube Ad Blocker Popup Removal",
  "author": "Saurav Hathi",
  "version": "1.0",
  "description": "YouTube Ad Blocker Popup Removal is a Google Chrome extension that removes the annoying popup that appears when you try to skip an ad on YouTube.",
  "permissions": ["activeTab", "scripting","alarms"],
  "icons": {
    "16": "images/icon16.png",
    "32": "images/icon32.png",
    "48": "images/icon48.png",
    "128": "images/icon128.png"
  },
  "background": {
    "service_worker": "background.js"
  },
  "content_scripts": [
    {
      "matches": ["https://*.youtube.com/*"],
      "js": ["content.js"],
      "css": ["content.css"]
    }
  ]
}

It's essential to remember that while ad-blocking can provide an ad-free experience, it's not without consequences. Many content creators rely on ad revenue to sustain their channels and produce high-quality content. If you wish to enjoy YouTube without ads and support creators at the same time, consider subscribing to YouTube Premium, which allows ad-free viewing while still compensating creators for their work.

In conclusion, the "YouTube Ad Blocker Popup Removal" Chrome extension by Saurav Hathi is a handy tool for those who want to bypass the YouTube ad blocker popup and maintain a pleasant viewing experience. However, it's crucial to remember that content creators rely on ad revenue to continue providing the content you love, so consider supporting them whenever possible.

👨‍💻 Author: Saurav Hathi 🌟 GitHub: https://github.com/sauravhathi 🚀 Linkedin: https://www.linkedin.com/in/sauravhathi

Happy ad-free browsing on YouTube! 🚀