Smart Adblock Layer Remover

Safely removes only adblock overlays without breaking the page

  1. // ==UserScript==
  2. // @name Smart Adblock Layer Remover
  3. // @namespace elite.adblock.surgical
  4. // @version 2.1
  5. // @description Safely removes only adblock overlays without breaking the page
  6. // @author Abdelali
  7. // @match *://*/*
  8. // @grant none
  9. // @run-at document-end
  10. // ==/UserScript==
  11.  
  12. (function () {
  13. 'use strict';
  14.  
  15. const keywords = [
  16. 'disable adblock', 'turn off adblock', 'please disable',
  17. 'bypass extension', 'stop using adblock', 'adblocker detected'
  18. ];
  19.  
  20. const observer = new MutationObserver(() => {
  21. document.querySelectorAll('div, section, article').forEach(el => {
  22. const txt = el.innerText?.toLowerCase() || '';
  23. const styles = getComputedStyle(el);
  24.  
  25. const isOverlay = (
  26. styles.position === 'fixed' &&
  27. (styles.zIndex > 1000 || styles.zIndex === '9999') &&
  28. styles.display !== 'none' &&
  29. styles.visibility !== 'hidden'
  30. );
  31.  
  32. const hasAdblockText = keywords.some(k => txt.includes(k));
  33.  
  34. if (isOverlay && hasAdblockText) {
  35. el.remove();
  36. console.log('✅ Removed Adblock Overlay:', el);
  37. }
  38. });
  39.  
  40. // Re-enable scroll and visibility
  41. document.body.style.overflow = 'auto';
  42. document.documentElement.style.overflow = 'auto';
  43. document.body.style.filter = 'none';
  44. document.body.style.pointerEvents = 'auto';
  45. });
  46.  
  47. observer.observe(document.body, {
  48. childList: true,
  49. subtree: true
  50. });
  51.  
  52. window.addEventListener('load', () => {
  53. document.body.style.overflow = 'auto';
  54. document.body.style.pointerEvents = 'auto';
  55. });
  56. })();