Basic Ad Blocker & Anti-Adblock Defeater (UserScript)

A basic UserScript to attempt blocking common ads, including pop-up video ads and unwanted new tab redirects, and some anti-adblock detection methods.

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

作者
Snow2122
日安装量
4
总安装量
362
评分
0 0 0
版本
2.1
创建于
2025-04-29
更新于
2025-06-29
大小
12.0 KB
许可证
MIT
适用于
所有网站

Basic UserScript Ad Blocker

A simple UserScript to block ads, pop-ups, video ads, and bypass basic anti-adblock detection across websites.

License: MIT

Key Features:

  • Ad Element Hiding: Removes banners, sidebars, and ad containers using CSS selectors.
  • Video Ad Blocker: Stops video ads by pausing, clearing, and removing video elements.
  • Pop-up/Redirect Block: Overrides window.open to block new tab redirects from known ad domains.
  • Anti-Adblock Bypass: Tricks basic adblock detectors by altering JavaScript variables and element properties.
  • Dynamic Ad Blocking: Uses MutationObserver to catch ads injected after page load.

How It Works:

  • Runs at page start to apply blocks early.
  • Hides ads instantly with injected CSS.
  • Monitors page for new ads continuously.
  • Blocks pop-unders and anti-adblock scripts before they trigger.

Important: This script offers basic protection. For stronger, network-level ad blocking, use extensions like uBlock Origin or AdGuard.

Installation Guide:

  1. Install Tampermonkey (Chrome, Edge, Firefox, Safari) or Greasemonkey (Firefox).
  2. Create a new script in the extension.
  3. Delete boilerplate code.
  4. Paste the full script code (including // ==UserScript== headers).
  5. Save and enable it. It will work automatically on supported sites.