ad-blockguard 0.1.0-pre
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/dist/blockguard.cjs.js +364 -0
- package/dist/blockguard.cjs.js.map +7 -0
- package/dist/blockguard.esm.js +344 -0
- package/dist/blockguard.esm.js.map +7 -0
- package/dist/blockguard.min.js +8 -0
- package/dist/blockguard.min.js.map +7 -0
- package/dist/blockguard.react.js +370 -0
- package/dist/blockguard.react.js.map +7 -0
- package/dist/blockguard.umd.js +366 -0
- package/dist/blockguard.umd.js.map +7 -0
- package/dist/blockguard.vue.js +372 -0
- package/dist/blockguard.vue.js.map +7 -0
- package/dist/index.html +167 -0
- package/package.json +60 -0
- package/readme.md +339 -0
- package/types/index.d.ts +43 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Ponk445
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,364 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/core.js
|
|
20
|
+
var core_exports = {};
|
|
21
|
+
__export(core_exports, {
|
|
22
|
+
default: () => core_default
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(core_exports);
|
|
25
|
+
var DEFAULT_TEST_URLS = [
|
|
26
|
+
"https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js",
|
|
27
|
+
"https://www.google-analytics.com/analytics.js",
|
|
28
|
+
"https://ad.doubleclick.net/ddm/pixel/1/1",
|
|
29
|
+
"https://www.googleadservices.com/pagead/conversion.js",
|
|
30
|
+
"https://cdn.taboola.com/libtrc/loader.js",
|
|
31
|
+
"https://connect.facebook.net/en_US/fbevents.js",
|
|
32
|
+
"https://www.googletagmanager.com/gtag/js"
|
|
33
|
+
];
|
|
34
|
+
var DEFAULT_BAIT_CONFIGS = [
|
|
35
|
+
{ classes: "ad ads ad-container banner-ad advertisement", attrs: { "data-ad-slot": "1234567890" } },
|
|
36
|
+
{ classes: "pub_300x250 pub_728x90 text-ad", attrs: { "data-ad-client": "ca-pub-0000000000000000" } },
|
|
37
|
+
{ classes: "adsbygoogle adsbox ad-placement AdContent", attrs: { "data-full-width-responsive": "true" } },
|
|
38
|
+
{ classes: "google-ad sponsored-content ad-banner BannerAd", attrs: { "data-ad-type": "banner" } }
|
|
39
|
+
];
|
|
40
|
+
var generateId = () => Math.random().toString(36).substring(2, 11);
|
|
41
|
+
var BlockGuard = class {
|
|
42
|
+
constructor(options = {}) {
|
|
43
|
+
this._isBrowser = typeof window !== "undefined" && typeof document !== "undefined";
|
|
44
|
+
this.config = {
|
|
45
|
+
// Core
|
|
46
|
+
checkOnLoad: options.checkOnLoad !== false,
|
|
47
|
+
debug: options.debug === true,
|
|
48
|
+
// Detection methods
|
|
49
|
+
networkTest: options.networkTest !== false,
|
|
50
|
+
// Primary – DNS blockers
|
|
51
|
+
bannerScan: options.bannerScan === true,
|
|
52
|
+
// Secondary – visual blockers, DEFAULT OFF
|
|
53
|
+
// Network config
|
|
54
|
+
testUrls: options.testUrls || DEFAULT_TEST_URLS,
|
|
55
|
+
// Completely replace defaults
|
|
56
|
+
extraTestUrls: options.extraTestUrls || [],
|
|
57
|
+
// Append to defaults
|
|
58
|
+
networkTestCount: options.networkTestCount || 3,
|
|
59
|
+
networkTimeout: options.networkTimeout || 5e3,
|
|
60
|
+
networkThreshold: options.networkThreshold || 2,
|
|
61
|
+
// Min blocked to trigger
|
|
62
|
+
// Banner scan config (only relevant if bannerScan: true)
|
|
63
|
+
customBaitClasses: options.customBaitClasses || [],
|
|
64
|
+
baitCheckInterval: options.baitCheckInterval || 100,
|
|
65
|
+
baitCheckAttempts: options.baitCheckAttempts || 5,
|
|
66
|
+
// Analytics
|
|
67
|
+
gtag: options.gtag === true,
|
|
68
|
+
// Auto-fire gtag if present, DEFAULT OFF (need on in config.)
|
|
69
|
+
gtagEventName: options.gtagEventName || "adblock_detected",
|
|
70
|
+
gtagParams: options.gtagParams || {},
|
|
71
|
+
// Custom analytics callback (result, reason, details) => void
|
|
72
|
+
analyticsCallback: options.analyticsCallback || null,
|
|
73
|
+
// Result callbacks
|
|
74
|
+
onDetected: options.onDetected || null,
|
|
75
|
+
onNotDetected: options.onNotDetected || null,
|
|
76
|
+
onResult: options.onResult || null
|
|
77
|
+
// Always fired: (detected, reason, details)
|
|
78
|
+
};
|
|
79
|
+
this._state = {
|
|
80
|
+
isChecking: false,
|
|
81
|
+
result: null,
|
|
82
|
+
reason: null,
|
|
83
|
+
details: {},
|
|
84
|
+
baits: [],
|
|
85
|
+
observer: null,
|
|
86
|
+
networkResults: []
|
|
87
|
+
};
|
|
88
|
+
this._callbacks = { detected: [], notDetected: [] };
|
|
89
|
+
if (this.config.onDetected) this.onDetected(this.config.onDetected);
|
|
90
|
+
if (this.config.onNotDetected) this.onNotDetected(this.config.onNotDetected);
|
|
91
|
+
if (this._isBrowser && this.config.checkOnLoad) {
|
|
92
|
+
if (document.readyState === "loading") {
|
|
93
|
+
document.addEventListener("DOMContentLoaded", () => this.check());
|
|
94
|
+
} else {
|
|
95
|
+
setTimeout(() => this.check(), 1);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
// --- Public API -------------
|
|
100
|
+
onDetected(fn) {
|
|
101
|
+
if (typeof fn === "function") this._callbacks.detected.push(fn);
|
|
102
|
+
return this;
|
|
103
|
+
}
|
|
104
|
+
onNotDetected(fn) {
|
|
105
|
+
if (typeof fn === "function") this._callbacks.notDetected.push(fn);
|
|
106
|
+
return this;
|
|
107
|
+
}
|
|
108
|
+
getResult() {
|
|
109
|
+
return this._state.result;
|
|
110
|
+
}
|
|
111
|
+
getReason() {
|
|
112
|
+
return this._state.reason;
|
|
113
|
+
}
|
|
114
|
+
getDetails() {
|
|
115
|
+
return this._state.details;
|
|
116
|
+
}
|
|
117
|
+
async check() {
|
|
118
|
+
if (!this._isBrowser) return null;
|
|
119
|
+
if (this._state.isChecking) {
|
|
120
|
+
this._log("Check already running");
|
|
121
|
+
return null;
|
|
122
|
+
}
|
|
123
|
+
if (this._state.result !== null) {
|
|
124
|
+
this._fireCallbacks(this._state.result);
|
|
125
|
+
return this._state.result;
|
|
126
|
+
}
|
|
127
|
+
this._state.isChecking = true;
|
|
128
|
+
this._log("Detection started");
|
|
129
|
+
if (this.config.bannerScan) {
|
|
130
|
+
this._injectBaits();
|
|
131
|
+
const baitDetected = await this._executeBaitChecks();
|
|
132
|
+
if (baitDetected) return this._state.result;
|
|
133
|
+
}
|
|
134
|
+
if (this.config.networkTest) {
|
|
135
|
+
const networkDetected = await this._runNetworkTests();
|
|
136
|
+
if (networkDetected) {
|
|
137
|
+
this._triggerDetection("network_blocked");
|
|
138
|
+
} else {
|
|
139
|
+
this._triggerClean();
|
|
140
|
+
}
|
|
141
|
+
} else if (!this.config.bannerScan) {
|
|
142
|
+
this._triggerClean();
|
|
143
|
+
}
|
|
144
|
+
return this._state.result;
|
|
145
|
+
}
|
|
146
|
+
reset() {
|
|
147
|
+
this._cleanup();
|
|
148
|
+
this._state.result = null;
|
|
149
|
+
this._state.reason = null;
|
|
150
|
+
this._state.details = {};
|
|
151
|
+
this._state.networkResults = [];
|
|
152
|
+
return this;
|
|
153
|
+
}
|
|
154
|
+
destroy() {
|
|
155
|
+
this._cleanup();
|
|
156
|
+
this._callbacks.detected = [];
|
|
157
|
+
this._callbacks.notDetected = [];
|
|
158
|
+
}
|
|
159
|
+
// ---- Network Tests ---------------
|
|
160
|
+
async _runNetworkTests() {
|
|
161
|
+
const allUrls = [
|
|
162
|
+
...this.config.testUrls,
|
|
163
|
+
...this.config.extraTestUrls
|
|
164
|
+
];
|
|
165
|
+
const picked = allUrls.sort(() => Math.random() - 0.5).slice(0, this.config.networkTestCount);
|
|
166
|
+
this._log("Network tests:", picked);
|
|
167
|
+
const results = await Promise.all(
|
|
168
|
+
picked.map((url, i) => this._testUrl(url, i))
|
|
169
|
+
);
|
|
170
|
+
this._state.networkResults = results;
|
|
171
|
+
this._state.details.networkResults = results;
|
|
172
|
+
const blockedCount = results.filter((r) => !r.reachable).length;
|
|
173
|
+
this._log(`Network: ${blockedCount}/${results.length} blocked`);
|
|
174
|
+
return blockedCount >= this.config.networkThreshold;
|
|
175
|
+
}
|
|
176
|
+
_testUrl(url, index) {
|
|
177
|
+
return new Promise((resolve) => {
|
|
178
|
+
const testUrl = url + (url.includes("?") ? "&" : "?") + "_bg=" + generateId();
|
|
179
|
+
let timer;
|
|
180
|
+
const img = new Image();
|
|
181
|
+
const done = (reachable, reason) => {
|
|
182
|
+
clearTimeout(timer);
|
|
183
|
+
resolve({ url, reachable, reason });
|
|
184
|
+
};
|
|
185
|
+
timer = setTimeout(() => done(false, "timeout"), this.config.networkTimeout);
|
|
186
|
+
img.onload = () => {
|
|
187
|
+
setTimeout(() => {
|
|
188
|
+
const entry = this._getPerfEntry(testUrl);
|
|
189
|
+
done(
|
|
190
|
+
!!(entry && entry.duration > 0),
|
|
191
|
+
entry ? "timing_confirmed" : "loaded_no_timing"
|
|
192
|
+
);
|
|
193
|
+
}, 100);
|
|
194
|
+
};
|
|
195
|
+
img.onerror = () => {
|
|
196
|
+
const entry = this._getPerfEntry(testUrl);
|
|
197
|
+
done(
|
|
198
|
+
!!(entry && entry.duration > 0),
|
|
199
|
+
entry ? "cors_reached" : "network_error"
|
|
200
|
+
);
|
|
201
|
+
};
|
|
202
|
+
img.src = testUrl;
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
_getPerfEntry(url) {
|
|
206
|
+
if (!window.performance?.getEntriesByType) return null;
|
|
207
|
+
const base = url.split("?")[0];
|
|
208
|
+
const entries = window.performance.getEntriesByType("resource");
|
|
209
|
+
for (let i = entries.length - 1; i >= 0; i--) {
|
|
210
|
+
if (entries[i].name.includes(base)) return entries[i];
|
|
211
|
+
}
|
|
212
|
+
return null;
|
|
213
|
+
}
|
|
214
|
+
// ─── Banner / Bait Scan ────────────────────────────────────────
|
|
215
|
+
_injectBaits() {
|
|
216
|
+
if (!document.body) {
|
|
217
|
+
setTimeout(() => this._injectBaits(), 50);
|
|
218
|
+
return;
|
|
219
|
+
}
|
|
220
|
+
const configs = [
|
|
221
|
+
...DEFAULT_BAIT_CONFIGS,
|
|
222
|
+
...this.config.customBaitClasses.map((cls) => ({ classes: cls, attrs: {} }))
|
|
223
|
+
];
|
|
224
|
+
configs.forEach((cfg) => {
|
|
225
|
+
const el = document.createElement("div");
|
|
226
|
+
el.id = `ad-${generateId()}`;
|
|
227
|
+
el.className = cfg.classes;
|
|
228
|
+
Object.entries(cfg.attrs).forEach(([k, v]) => el.setAttribute(k, v));
|
|
229
|
+
el.style.cssText = "width:1px!important;height:1px!important;position:absolute!important;left:-10000px!important;top:-10000px!important;z-index:-1!important;";
|
|
230
|
+
el.appendChild(Object.assign(document.createElement("ins"), { className: "adsbygoogle" }));
|
|
231
|
+
this._state.baits.push(el);
|
|
232
|
+
document.body.appendChild(el);
|
|
233
|
+
void el.offsetHeight;
|
|
234
|
+
});
|
|
235
|
+
if (window.MutationObserver) {
|
|
236
|
+
this._state.observer = new MutationObserver((mutations) => {
|
|
237
|
+
for (const m of mutations) {
|
|
238
|
+
if (m.type === "childList") {
|
|
239
|
+
for (const node of m.removedNodes) {
|
|
240
|
+
if (this._state.baits.includes(node)) {
|
|
241
|
+
this._triggerDetection("bait_removed");
|
|
242
|
+
return;
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
if (m.type === "attributes" && this._state.baits.includes(m.target)) {
|
|
247
|
+
setTimeout(() => {
|
|
248
|
+
if (this._checkBaitsBlocked()) this._triggerDetection("bait_modified");
|
|
249
|
+
}, 50);
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
});
|
|
253
|
+
this._state.observer.observe(document.body, {
|
|
254
|
+
childList: true,
|
|
255
|
+
subtree: true,
|
|
256
|
+
attributes: true,
|
|
257
|
+
attributeFilter: ["style", "class"]
|
|
258
|
+
});
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
_checkBaitsBlocked() {
|
|
262
|
+
for (const el of this._state.baits) {
|
|
263
|
+
if (!document.body.contains(el)) return true;
|
|
264
|
+
if (el.offsetParent === null) return true;
|
|
265
|
+
if (el.offsetHeight === 0 || el.offsetWidth === 0) return true;
|
|
266
|
+
if (window.getComputedStyle) {
|
|
267
|
+
const s = window.getComputedStyle(el);
|
|
268
|
+
if (s.display === "none" || s.visibility === "hidden" || parseFloat(s.opacity) === 0) return true;
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
if (document.body.getAttribute("abp") !== null) return true;
|
|
272
|
+
return false;
|
|
273
|
+
}
|
|
274
|
+
async _executeBaitChecks() {
|
|
275
|
+
return new Promise((resolve) => {
|
|
276
|
+
let attempts = 0;
|
|
277
|
+
const check = () => {
|
|
278
|
+
if (this._state.result !== null) {
|
|
279
|
+
resolve(true);
|
|
280
|
+
return;
|
|
281
|
+
}
|
|
282
|
+
if (this._checkBaitsBlocked()) {
|
|
283
|
+
this._triggerDetection("bait_blocked");
|
|
284
|
+
resolve(true);
|
|
285
|
+
return;
|
|
286
|
+
}
|
|
287
|
+
if (++attempts >= this.config.baitCheckAttempts) {
|
|
288
|
+
resolve(false);
|
|
289
|
+
return;
|
|
290
|
+
}
|
|
291
|
+
setTimeout(check, this.config.baitCheckInterval);
|
|
292
|
+
};
|
|
293
|
+
check();
|
|
294
|
+
});
|
|
295
|
+
}
|
|
296
|
+
// ─── Trigger / Callbacks ───────────────────────────────────────
|
|
297
|
+
_triggerDetection(reason) {
|
|
298
|
+
if (this._state.result !== null) return;
|
|
299
|
+
this._log("DETECTED:", reason);
|
|
300
|
+
this._state.result = true;
|
|
301
|
+
this._state.reason = reason;
|
|
302
|
+
this._finalize(true);
|
|
303
|
+
}
|
|
304
|
+
_triggerClean() {
|
|
305
|
+
if (this._state.result !== null) return;
|
|
306
|
+
this._log("CLEAN");
|
|
307
|
+
this._state.result = false;
|
|
308
|
+
this._state.reason = "all_passed";
|
|
309
|
+
this._finalize(false);
|
|
310
|
+
}
|
|
311
|
+
_finalize(detected) {
|
|
312
|
+
this._cleanup();
|
|
313
|
+
if (detected && this.config.gtag && typeof window.gtag === "function") {
|
|
314
|
+
window.gtag("event", this.config.gtagEventName, {
|
|
315
|
+
reason: this._state.reason,
|
|
316
|
+
...this.config.gtagParams
|
|
317
|
+
});
|
|
318
|
+
this._log("gtag fired:", this.config.gtagEventName);
|
|
319
|
+
}
|
|
320
|
+
if (typeof this.config.analyticsCallback === "function") {
|
|
321
|
+
try {
|
|
322
|
+
this.config.analyticsCallback(detected, this._state.reason, this._state.details);
|
|
323
|
+
} catch (e) {
|
|
324
|
+
console.error("[BlockGuard] analyticsCallback error:", e);
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
if (typeof this.config.onResult === "function") {
|
|
328
|
+
try {
|
|
329
|
+
this.config.onResult(detected, this._state.reason, this._state.details);
|
|
330
|
+
} catch (e) {
|
|
331
|
+
console.error("[BlockGuard] onResult error:", e);
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
this._fireCallbacks(detected);
|
|
335
|
+
}
|
|
336
|
+
_fireCallbacks(detected) {
|
|
337
|
+
const list = this._callbacks[detected ? "detected" : "notDetected"];
|
|
338
|
+
list.forEach((fn) => {
|
|
339
|
+
try {
|
|
340
|
+
fn();
|
|
341
|
+
} catch (e) {
|
|
342
|
+
console.error("[BlockGuard] Callback error:", e);
|
|
343
|
+
}
|
|
344
|
+
});
|
|
345
|
+
}
|
|
346
|
+
_cleanup() {
|
|
347
|
+
this._state.baits.forEach((el) => el?.parentNode?.removeChild(el));
|
|
348
|
+
this._state.baits = [];
|
|
349
|
+
this._state.observer?.disconnect();
|
|
350
|
+
this._state.observer = null;
|
|
351
|
+
this._state.isChecking = false;
|
|
352
|
+
}
|
|
353
|
+
_log(...args) {
|
|
354
|
+
if (this.config.debug) console.log("[BlockGuard]", ...args);
|
|
355
|
+
}
|
|
356
|
+
};
|
|
357
|
+
var core_default = BlockGuard;
|
|
358
|
+
/*!
|
|
359
|
+
* BlockGuard 0.1.0
|
|
360
|
+
* Universal AdBlock & DNS-Blocker Detection - stop nasty tools from interfering with your website's ads and analytics.
|
|
361
|
+
* (c) 2026 Ponk445 — MIT License
|
|
362
|
+
* https://github.com/Ponk445/AD-BlockGuard
|
|
363
|
+
*/
|
|
364
|
+
//# sourceMappingURL=blockguard.cjs.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/core.js"],
|
|
4
|
+
"sourcesContent": ["/*!\r\n * BlockGuard 0.1.0\r\n * Universal AdBlock & DNS-Blocker Detection - stop nasty tools from interfering with your website's ads and analytics.\r\n * (c) 2026 Ponk445 \u2014 MIT License\r\n * https://github.com/Ponk445/AD-BlockGuard\r\n */\r\n\r\nconst DEFAULT_TEST_URLS = [\r\n 'https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js',\r\n 'https://www.google-analytics.com/analytics.js',\r\n 'https://ad.doubleclick.net/ddm/pixel/1/1',\r\n 'https://www.googleadservices.com/pagead/conversion.js',\r\n 'https://cdn.taboola.com/libtrc/loader.js',\r\n 'https://connect.facebook.net/en_US/fbevents.js',\r\n 'https://www.googletagmanager.com/gtag/js',\r\n];\r\n\r\nconst DEFAULT_BAIT_CONFIGS = [\r\n { classes: 'ad ads ad-container banner-ad advertisement', attrs: { 'data-ad-slot': '1234567890' } },\r\n { classes: 'pub_300x250 pub_728x90 text-ad', attrs: { 'data-ad-client': 'ca-pub-0000000000000000' } },\r\n { classes: 'adsbygoogle adsbox ad-placement AdContent', attrs: { 'data-full-width-responsive': 'true' } },\r\n { classes: 'google-ad sponsored-content ad-banner BannerAd', attrs: { 'data-ad-type': 'banner' } },\r\n];\r\n\r\nconst generateId = () => Math.random().toString(36).substring(2, 11);\r\n\r\nclass BlockGuard {\r\n constructor(options = {}) {\r\n // \u2500\u2500 SSR guard (Next.js, Nuxt SSR etc.)\r\n this._isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined';\r\n\r\n this.config = {\r\n // Core\r\n checkOnLoad: options.checkOnLoad !== false,\r\n debug: options.debug === true,\r\n\r\n // Detection methods\r\n networkTest: options.networkTest !== false, // Primary \u2013 DNS blockers\r\n bannerScan: options.bannerScan === true, // Secondary \u2013 visual blockers, DEFAULT OFF\r\n\r\n // Network config\r\n testUrls: options.testUrls || DEFAULT_TEST_URLS, // Completely replace defaults\r\n extraTestUrls: options.extraTestUrls || [], // Append to defaults\r\n networkTestCount: options.networkTestCount || 3,\r\n networkTimeout: options.networkTimeout || 5000,\r\n networkThreshold: options.networkThreshold || 2, // Min blocked to trigger\r\n\r\n // Banner scan config (only relevant if bannerScan: true)\r\n customBaitClasses: options.customBaitClasses || [],\r\n baitCheckInterval: options.baitCheckInterval || 100,\r\n baitCheckAttempts: options.baitCheckAttempts || 5,\r\n\r\n // Analytics\r\n gtag: options.gtag === true, // Auto-fire gtag if present, DEFAULT OFF (need on in config.)\r\n gtagEventName: options.gtagEventName || 'adblock_detected',\r\n gtagParams: options.gtagParams || {},\r\n\r\n // Custom analytics callback (result, reason, details) => void\r\n analyticsCallback: options.analyticsCallback || null,\r\n\r\n // Result callbacks\r\n onDetected: options.onDetected || null,\r\n onNotDetected: options.onNotDetected || null,\r\n onResult: options.onResult || null, // Always fired: (detected, reason, details)\r\n };\r\n\r\n this._state = {\r\n isChecking: false,\r\n result: null,\r\n reason: null,\r\n details: {},\r\n baits: [],\r\n observer: null,\r\n networkResults: [],\r\n };\r\n\r\n this._callbacks = { detected: [], notDetected: [] };\r\n\r\n if (this.config.onDetected) this.onDetected(this.config.onDetected);\r\n if (this.config.onNotDetected) this.onNotDetected(this.config.onNotDetected);\r\n\r\n if (this._isBrowser && this.config.checkOnLoad) {\r\n if (document.readyState === 'loading') {\r\n document.addEventListener('DOMContentLoaded', () => this.check());\r\n } else {\r\n setTimeout(() => this.check(), 1);\r\n }\r\n }\r\n }\r\n\r\n // --- Public API -------------\r\n onDetected(fn) { if (typeof fn === 'function') this._callbacks.detected.push(fn); return this; }\r\n onNotDetected(fn) { if (typeof fn === 'function') this._callbacks.notDetected.push(fn); return this; }\r\n getResult() { return this._state.result; }\r\n getReason() { return this._state.reason; }\r\n getDetails() { return this._state.details; }\r\n\r\n async check() {\r\n if (!this._isBrowser) return null;\r\n if (this._state.isChecking) { this._log('Check already running'); return null; }\r\n\r\n if (this._state.result !== null) {\r\n this._fireCallbacks(this._state.result);\r\n return this._state.result;\r\n }\r\n\r\n this._state.isChecking = true;\r\n this._log('Detection started');\r\n\r\n // 1: Banner scan (if enabled)\r\n if (this.config.bannerScan) {\r\n this._injectBaits();\r\n const baitDetected = await this._executeBaitChecks();\r\n if (baitDetected) return this._state.result;\r\n }\r\n\r\n // 2: Network test\r\n if (this.config.networkTest) {\r\n const networkDetected = await this._runNetworkTests();\r\n if (networkDetected) {\r\n this._triggerDetection('network_blocked');\r\n } else {\r\n this._triggerClean();\r\n }\r\n } else if (!this.config.bannerScan) {\r\n this._triggerClean();\r\n }\r\n\r\n return this._state.result;\r\n }\r\n\r\n reset() {\r\n this._cleanup();\r\n this._state.result = null;\r\n this._state.reason = null;\r\n this._state.details = {};\r\n this._state.networkResults = [];\r\n return this;\r\n }\r\n\r\n destroy() {\r\n this._cleanup();\r\n this._callbacks.detected = [];\r\n this._callbacks.notDetected = [];\r\n }\r\n\r\n // ---- Network Tests ---------------\r\n\r\n async _runNetworkTests() {\r\n const allUrls = [\r\n ...this.config.testUrls,\r\n ...this.config.extraTestUrls,\r\n ];\r\n\r\n const picked = allUrls\r\n .sort(() => Math.random() - 0.5)\r\n .slice(0, this.config.networkTestCount);\r\n\r\n this._log('Network tests:', picked);\r\n\r\n const results = await Promise.all(\r\n picked.map((url, i) => this._testUrl(url, i))\r\n );\r\n\r\n this._state.networkResults = results;\r\n this._state.details.networkResults = results;\r\n\r\n const blockedCount = results.filter(r => !r.reachable).length;\r\n this._log(`Network: ${blockedCount}/${results.length} blocked`);\r\n\r\n return blockedCount >= this.config.networkThreshold;\r\n }\r\n\r\n _testUrl(url, index) {\r\n return new Promise((resolve) => {\r\n const testUrl = url + (url.includes('?') ? '&' : '?') + '_bg=' + generateId();\r\n let timer;\r\n const img = new Image();\r\n\r\n const done = (reachable, reason) => {\r\n clearTimeout(timer);\r\n resolve({ url, reachable, reason });\r\n };\r\n\r\n timer = setTimeout(() => done(false, 'timeout'), this.config.networkTimeout);\r\n\r\n img.onload = () => {\r\n setTimeout(() => {\r\n const entry = this._getPerfEntry(testUrl);\r\n done(\r\n !!(entry && entry.duration > 0),\r\n entry ? 'timing_confirmed' : 'loaded_no_timing'\r\n );\r\n }, 100);\r\n };\r\n\r\n img.onerror = () => {\r\n const entry = this._getPerfEntry(testUrl);\r\n // CORS error but server reached, so not blocked\r\n done(\r\n !!(entry && entry.duration > 0),\r\n entry ? 'cors_reached' : 'network_error'\r\n );\r\n };\r\n\r\n img.src = testUrl;\r\n });\r\n }\r\n\r\n _getPerfEntry(url) {\r\n if (!window.performance?.getEntriesByType) return null;\r\n const base = url.split('?')[0];\r\n const entries = window.performance.getEntriesByType('resource');\r\n for (let i = entries.length - 1; i >= 0; i--) {\r\n if (entries[i].name.includes(base)) return entries[i];\r\n }\r\n return null;\r\n }\r\n\r\n // \u2500\u2500\u2500 Banner / Bait Scan \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\r\n\r\n _injectBaits() {\r\n if (!document.body) {\r\n setTimeout(() => this._injectBaits(), 50);\r\n return;\r\n }\r\n\r\n const configs = [\r\n ...DEFAULT_BAIT_CONFIGS,\r\n ...this.config.customBaitClasses.map(cls => ({ classes: cls, attrs: {} })),\r\n ];\r\n\r\n configs.forEach(cfg => {\r\n const el = document.createElement('div');\r\n el.id = `ad-${generateId()}`;\r\n el.className = cfg.classes;\r\n Object.entries(cfg.attrs).forEach(([k, v]) => el.setAttribute(k, v));\r\n el.style.cssText = 'width:1px!important;height:1px!important;position:absolute!important;left:-10000px!important;top:-10000px!important;z-index:-1!important;';\r\n el.appendChild(Object.assign(document.createElement('ins'), { className: 'adsbygoogle' }));\r\n this._state.baits.push(el);\r\n document.body.appendChild(el);\r\n void el.offsetHeight;\r\n });\r\n\r\n if (window.MutationObserver) {\r\n this._state.observer = new MutationObserver(mutations => {\r\n for (const m of mutations) {\r\n if (m.type === 'childList') {\r\n for (const node of m.removedNodes) {\r\n if (this._state.baits.includes(node)) {\r\n this._triggerDetection('bait_removed');\r\n return;\r\n }\r\n }\r\n }\r\n if (m.type === 'attributes' && this._state.baits.includes(m.target)) {\r\n setTimeout(() => {\r\n if (this._checkBaitsBlocked()) this._triggerDetection('bait_modified');\r\n }, 50);\r\n }\r\n }\r\n });\r\n this._state.observer.observe(document.body, {\r\n childList: true, subtree: true,\r\n attributes: true, attributeFilter: ['style', 'class'],\r\n });\r\n }\r\n }\r\n\r\n _checkBaitsBlocked() {\r\n for (const el of this._state.baits) {\r\n if (!document.body.contains(el)) return true;\r\n if (el.offsetParent === null) return true;\r\n if (el.offsetHeight === 0 || el.offsetWidth === 0) return true;\r\n if (window.getComputedStyle) {\r\n const s = window.getComputedStyle(el);\r\n if (s.display === 'none' || s.visibility === 'hidden' || parseFloat(s.opacity) === 0) return true;\r\n }\r\n }\r\n if (document.body.getAttribute('abp') !== null) return true;\r\n return false;\r\n }\r\n\r\n async _executeBaitChecks() {\r\n return new Promise(resolve => {\r\n let attempts = 0;\r\n const check = () => {\r\n if (this._state.result !== null) { resolve(true); return; }\r\n if (this._checkBaitsBlocked()) {\r\n this._triggerDetection('bait_blocked');\r\n resolve(true);\r\n return;\r\n }\r\n if (++attempts >= this.config.baitCheckAttempts) { resolve(false); return; }\r\n setTimeout(check, this.config.baitCheckInterval);\r\n };\r\n check();\r\n });\r\n }\r\n\r\n // \u2500\u2500\u2500 Trigger / Callbacks \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\r\n\r\n _triggerDetection(reason) {\r\n if (this._state.result !== null) return;\r\n this._log('DETECTED:', reason);\r\n this._state.result = true;\r\n this._state.reason = reason;\r\n this._finalize(true);\r\n }\r\n\r\n _triggerClean() {\r\n if (this._state.result !== null) return;\r\n this._log('CLEAN');\r\n this._state.result = false;\r\n this._state.reason = 'all_passed';\r\n this._finalize(false);\r\n }\r\n\r\n _finalize(detected) {\r\n this._cleanup();\r\n\r\n // Built-in gtag\r\n if (detected && this.config.gtag && typeof window.gtag === 'function') {\r\n window.gtag('event', this.config.gtagEventName, {\r\n reason: this._state.reason,\r\n ...this.config.gtagParams,\r\n });\r\n this._log('gtag fired:', this.config.gtagEventName);\r\n }\r\n\r\n // Custom analytics callback\r\n if (typeof this.config.analyticsCallback === 'function') {\r\n try {\r\n this.config.analyticsCallback(detected, this._state.reason, this._state.details);\r\n } catch (e) { console.error('[BlockGuard] analyticsCallback error:', e); }\r\n }\r\n\r\n // onResult (always)\r\n if (typeof this.config.onResult === 'function') {\r\n try { this.config.onResult(detected, this._state.reason, this._state.details); }\r\n catch (e) { console.error('[BlockGuard] onResult error:', e); }\r\n }\r\n\r\n this._fireCallbacks(detected);\r\n }\r\n\r\n _fireCallbacks(detected) {\r\n const list = this._callbacks[detected ? 'detected' : 'notDetected'];\r\n list.forEach(fn => { try { fn(); } catch (e) { console.error('[BlockGuard] Callback error:', e); } });\r\n }\r\n\r\n _cleanup() {\r\n this._state.baits.forEach(el => el?.parentNode?.removeChild(el));\r\n this._state.baits = [];\r\n this._state.observer?.disconnect();\r\n this._state.observer = null;\r\n this._state.isChecking = false;\r\n }\r\n\r\n _log(...args) {\r\n if (this.config.debug) console.log('[BlockGuard]', ...args);\r\n }\r\n}\r\n\r\nexport default BlockGuard;\r\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA,IAAM,oBAAoB;AAAA,EACxB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEA,IAAM,uBAAuB;AAAA,EAC3B,EAAE,SAAS,+CAA+C,OAAO,EAAE,gBAAgB,aAAa,EAAE;AAAA,EAClG,EAAE,SAAS,kCAAkC,OAAO,EAAE,kBAAkB,0BAA0B,EAAE;AAAA,EACpG,EAAE,SAAS,6CAA6C,OAAO,EAAE,8BAA8B,OAAO,EAAE;AAAA,EACxG,EAAE,SAAS,kDAAkD,OAAO,EAAE,gBAAgB,SAAS,EAAE;AACnG;AAEA,IAAM,aAAa,MAAM,KAAK,OAAO,EAAE,SAAS,EAAE,EAAE,UAAU,GAAG,EAAE;AAEnE,IAAM,aAAN,MAAiB;AAAA,EACf,YAAY,UAAU,CAAC,GAAG;AAExB,SAAK,aAAa,OAAO,WAAW,eAAe,OAAO,aAAa;AAEvE,SAAK,SAAS;AAAA;AAAA,MAEZ,aAAoB,QAAQ,gBAAgB;AAAA,MAC5C,OAAoB,QAAQ,UAAU;AAAA;AAAA,MAGtC,aAAoB,QAAQ,gBAAgB;AAAA;AAAA,MAC5C,YAAoB,QAAQ,eAAe;AAAA;AAAA;AAAA,MAG3C,UAAoB,QAAQ,YAAY;AAAA;AAAA,MACxC,eAAoB,QAAQ,iBAAiB,CAAC;AAAA;AAAA,MAC9C,kBAAoB,QAAQ,oBAAo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