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.

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 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.