tsmnt-ad-shield
English | 简体中文
An ad-removal userscript for tsmnt.com: pins the visit-frequency cookie, sweeps the layered ad-loader chain from the DOM, and blocks cross-origin popups. Targets the random popunders fired when clicking "next page" plus the in-page ad slots. Works on desktop and mobile.
Problem
- Clicking "next page" randomly opens a new ad page (popunder)
- Banner/placeholder ads on the page itself
Reverse-engineering notes (2026-10, evidence in analysis/)
js/dh.js: increments the `visits` cookie on every pageview (the frequency gate)
├─ js/vtj.js -> (desktop) js/pc.js
│ └─ on paginated pages (URL contains _), when visits>3, randomly loads
│ vdn/hi1-4.js (even visits) or vdn/cpv1-4.js (odd) - the click-
│ triggered popup engines ("next page" randomly opens an ad page)
└─ cdn/pic.js -> (desktop) vdn/gd.js
└─ when visits>4, injects a gummy-debt.com script (Monetag-family popunder)
Other ads / tracking
| Item |
Notes |
tsmnt/a2+a4+a5+a6.js |
ad placeholder scripts (write <SPAN id=a163/d5tig/...> slots, load vdn/gds.js) |
tsmnt/a8.js |
loads js/dh.js + js/vtj.js + js/fp.js (FingerprintJS), reports a tracking pixel to xs.255155.xyz |
vdn/gds.js |
banner ads gated on visits>4 (JuicyAds/ExoClick rotation, mostly commented out) |
Exception: tsmnt/a1.js |
writes the SITE NAVIGATION (.nav#navh) - must stay |
Images and pagination are plain <img>/<a> in the static HTML; no gallery script is required for normal browsing.
Design (four independent layers)
| Layer |
Approach |
| L1 cookie pin |
At document-start, set visits=0. Every ad loader reads this cookie before firing, so all gates stay shut even if a loader slips through the sweep (dh.js is swept, nothing re-increments it) |
| L2 script sweep |
Debounced MutationObserver full-document sweep with a blacklist of regexps: /tsmnt/a[2-9]+.js (a1 kept), /vdn/gds?.js, /vdn/(hi|cpv)N.js, /js/(vtj|pc|dh|fp).js, /cdn/(pic|lam).js, /sa/mcpcN.js, gummy-debt.com. Path-based matching covers js. mirror rotation automatically |
| L3 popup guard |
Wraps window.open, dropping cross-origin popups (ad landing pages are always cross-origin; the site navigates via native anchors) |
Trade-off (accepted, documented): sweeping the a8->dh.js chain also drops the favorites feature (scj.js) and the translate widgets; the fingerprint tracking and stats pixel disappear with it (a privacy win). Image browsing and pagination are unaffected.
Install
- Install Tampermonkey (Chrome: enable "Developer mode" on the extensions page)
- Create a new script and paste the full contents of
tsmnt-ad-shield.user.js
Verify
- Open any gallery pagination (e.g.
308441_2.html) and click "next page" repeatedly → no more ad popups
- No banner/placeholder ads; the nav bar is still there
- DevTools console:
[tsmnt净化] v1.0.0 enabled, occasionally swept N ad script(s) and blocked cross-origin popup
document.cookie contains visits=0; images, pagination and board navigation all work
Maintenance
- New ad loader path: check the script URL in DevTools Network and add a regexp to
BLACKLIST (patterns work against any js. mirror)
- Nav menu disappears one day: the site probably moved it out of a1.js - then add a1 to the blacklist (or drop the exception)
- Mirror domains: add an
@match
Layout
tsmnt-ad-shield.user.js — the userscript
analysis/ — evidence
page-snapshot-gb2312.html / page-snapshot-utf8.html — raw gallery-page snapshots (a* call sites, bzs placeholders, pagination)
scripts/ — snapshots of every script in the ad chain (a1~a8, pic, dh, gd, gds, vtj, pc, lam, scj, incl. obfuscated parts)
abctest/ — replica experiment page and results