Remove YouTube Adblock Message & Overlay

Removes YouTube's adblock warning by deleting ytd-popup-container and the overlay backdrop

  1. // ==UserScript==
  2. // @name Remove YouTube Adblock Message & Overlay
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.2
  5. // @description Removes YouTube's adblock warning by deleting ytd-popup-container and the overlay backdrop
  6. // @author drewby123
  7. // @match *://www.youtube.com/*
  8. // @grant none
  9. // @run-at document-idle
  10. // @license MIT
  11. // ==/UserScript==
  12.  
  13. (function () {
  14. 'use strict';
  15.  
  16. const removeElements = () => {
  17. const popupContainer = document.querySelector('ytd-popup-container');
  18. const overlayBackdrop = document.querySelector('tp-yt-iron-overlay-backdrop');
  19.  
  20. if (popupContainer) {
  21. popupContainer.remove();
  22. console.log('Removed ytd-popup-container');
  23. }
  24.  
  25. if (overlayBackdrop) {
  26. overlayBackdrop.remove();
  27. console.log('Removed overlay backdrop');
  28. }
  29. };
  30.  
  31. // Run initially
  32. removeElements();
  33.  
  34. // Observe and re-run when elements are reinserted
  35. const observer = new MutationObserver(removeElements);
  36.  
  37. observer.observe(document.body, {
  38. childList: true,
  39. subtree: true
  40. });
  41. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址