nodebb-plugin-ezoic-infinite 1.4.86 → 1.4.88
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/package.json +1 -1
- package/public/client.js +22 -24
- package/public/style.css +28 -3
package/package.json
CHANGED
package/public/client.js
CHANGED
|
@@ -12,8 +12,6 @@
|
|
|
12
12
|
let EZOIC_BLOCKED = false;
|
|
13
13
|
|
|
14
14
|
// DEBUG: Vérifier que le plugin charge
|
|
15
|
-
console.log('[NODEBB-EZOIC] Plugin chargé et initialisé');
|
|
16
|
-
console.log('[NODEBB-EZOIC] EZOIC_BLOCKED initial:', EZOIC_BLOCKED);
|
|
17
15
|
|
|
18
16
|
const sessionDefinedIds = new Set();
|
|
19
17
|
|
|
@@ -149,25 +147,39 @@
|
|
|
149
147
|
const ph = wrapper.querySelector('[id^="ezoic-pub-ad-placeholder-"]');
|
|
150
148
|
if (!ph) return;
|
|
151
149
|
|
|
152
|
-
//
|
|
153
|
-
// CRITIQUE: Ne JAMAIS toucher au placeholder ou ses enfants
|
|
150
|
+
// ULTRA-AGRESSIF: Supprimer TOUT sauf placeholder
|
|
154
151
|
Array.from(wrapper.children).forEach(child => {
|
|
155
|
-
|
|
156
|
-
if (child === ph) return;
|
|
157
|
-
if (child.contains(ph)) return;
|
|
152
|
+
if (child === ph || child.contains(ph)) return;
|
|
158
153
|
if (child.id && child.id.startsWith('ezoic-pub-ad-placeholder-')) return;
|
|
159
|
-
|
|
160
|
-
// Supprimer le reste
|
|
161
154
|
child.remove();
|
|
162
155
|
});
|
|
163
156
|
|
|
164
|
-
// Forcer wrapper
|
|
157
|
+
// Forcer wrapper collé
|
|
165
158
|
wrapper.style.height = 'auto';
|
|
166
159
|
wrapper.style.overflow = 'hidden';
|
|
167
160
|
wrapper.style.lineHeight = '0';
|
|
161
|
+
wrapper.style.fontSize = '0';
|
|
162
|
+
wrapper.style.margin = '0';
|
|
163
|
+
wrapper.style.padding = '0';
|
|
164
|
+
|
|
165
|
+
// Nettoyer aussi DANS le placeholder
|
|
166
|
+
if (ph) {
|
|
167
|
+
Array.from(ph.children).forEach(child => {
|
|
168
|
+
// Garder seulement iframe, ins, img
|
|
169
|
+
const tag = child.tagName;
|
|
170
|
+
if (tag !== 'IFRAME' && tag !== 'INS' && tag !== 'IMG' && tag !== 'DIV') {
|
|
171
|
+
child.remove();
|
|
172
|
+
}
|
|
173
|
+
});
|
|
174
|
+
}
|
|
168
175
|
});
|
|
169
176
|
} catch (e) {}
|
|
170
177
|
}
|
|
178
|
+
|
|
179
|
+
// Lancer cleanup périodique toutes les 2s
|
|
180
|
+
setInterval(() => {
|
|
181
|
+
try { cleanupInvisibleEzoicElements(); } catch (e) {}
|
|
182
|
+
}, 2000);
|
|
171
183
|
|
|
172
184
|
function cleanupEmptyWrappers() {
|
|
173
185
|
try {
|
|
@@ -287,15 +299,11 @@
|
|
|
287
299
|
if (typeof ez.showAds !== 'function') return;
|
|
288
300
|
|
|
289
301
|
window.__nodebbEzoicPatched = true;
|
|
290
|
-
console.log('[NODEBB-EZOIC] Patch Ezoic appliqué !');
|
|
291
302
|
const orig = ez.showAds;
|
|
292
303
|
|
|
293
304
|
ez.showAds = function (arg) {
|
|
294
|
-
console.log('[NODEBB-EZOIC] showAds() appelé, arg:', arg, 'BLOCKED:', EZOIC_BLOCKED);
|
|
295
|
-
|
|
296
305
|
// CRITIQUE: Bloquer TOUS appels si navigation en cours
|
|
297
306
|
if (EZOIC_BLOCKED) {
|
|
298
|
-
console.log('[NODEBB-EZOIC] showAds() BLOQUÉ par flag');
|
|
299
307
|
return; // Ignorer complètement
|
|
300
308
|
}
|
|
301
309
|
|
|
@@ -441,7 +449,6 @@
|
|
|
441
449
|
// Appeler showAds avec TOUS les IDs en une fois
|
|
442
450
|
try {
|
|
443
451
|
// CRITIQUE: Re-patcher AVANT chaque appel pour être sûr
|
|
444
|
-
console.log('[NODEBB-EZOIC] Re-patch avant showAds');
|
|
445
452
|
patchShowAds();
|
|
446
453
|
|
|
447
454
|
window.ezstandalone = window.ezstandalone || {};
|
|
@@ -639,11 +646,8 @@
|
|
|
639
646
|
|
|
640
647
|
function cleanup() {
|
|
641
648
|
// DEBUG: Vérifier que cleanup est appelé
|
|
642
|
-
console.log('[NODEBB-EZOIC] cleanup() appelé');
|
|
643
|
-
|
|
644
649
|
// CRITIQUE: BLOQUER Ezoic immédiatement
|
|
645
650
|
EZOIC_BLOCKED = true;
|
|
646
|
-
console.log('[NODEBB-EZOIC] EZOIC_BLOCKED = true');
|
|
647
651
|
|
|
648
652
|
// Détruire TOUS les placeholders Ezoic AVANT de supprimer DOM
|
|
649
653
|
const allWrappers = document.querySelectorAll('.ezoic-ad');
|
|
@@ -658,7 +662,6 @@
|
|
|
658
662
|
|
|
659
663
|
// CRITIQUE: Vider COMPLÈTEMENT sessionDefinedIds
|
|
660
664
|
// Pour éviter que d'anciens IDs soient encore en mémoire
|
|
661
|
-
console.log('[NODEBB-EZOIC] Suppression IDs du DOM:', allIds);
|
|
662
665
|
|
|
663
666
|
// CRITIQUE: Détruire AUSSI tous les IDs tracés dans state
|
|
664
667
|
// Pour annuler les anciens IDs qu'Ezoic a en mémoire
|
|
@@ -669,8 +672,6 @@
|
|
|
669
672
|
];
|
|
670
673
|
|
|
671
674
|
const allIdsToDestroy = [...new Set([...allIds, ...trackedIds, ...Array.from(sessionDefinedIds)])];
|
|
672
|
-
console.log('[NODEBB-EZOIC] Destroy TOUS les IDs tracés:', allIdsToDestroy);
|
|
673
|
-
console.log('[NODEBB-EZOIC] Vidage COMPLET de sessionDefinedIds');
|
|
674
675
|
sessionDefinedIds.clear(); // ✅ VIDER TOUT
|
|
675
676
|
|
|
676
677
|
if (allIdsToDestroy.length > 0) {
|
|
@@ -723,7 +724,6 @@
|
|
|
723
724
|
async function runCore() {
|
|
724
725
|
// CRITIQUE: Ne rien insérer si navigation en cours
|
|
725
726
|
if (EZOIC_BLOCKED) {
|
|
726
|
-
console.log('[NODEBB-EZOIC] runCore bloqué - navigation en cours');
|
|
727
727
|
return;
|
|
728
728
|
}
|
|
729
729
|
|
|
@@ -816,7 +816,6 @@
|
|
|
816
816
|
state.pageKey = getPageKey();
|
|
817
817
|
|
|
818
818
|
// Débloquer Ezoic IMMÉDIATEMENT pour la nouvelle page
|
|
819
|
-
console.log('[NODEBB-EZOIC] ajaxify.end - Déblocage Ezoic');
|
|
820
819
|
EZOIC_BLOCKED = false;
|
|
821
820
|
|
|
822
821
|
ensureObserver();
|
|
@@ -824,7 +823,6 @@
|
|
|
824
823
|
state.canShowAds = true;
|
|
825
824
|
|
|
826
825
|
// CRITIQUE: Relancer insertion maintenant que navigation est terminée
|
|
827
|
-
console.log('[NODEBB-EZOIC] Relancer insertion pubs');
|
|
828
826
|
scheduleRun();
|
|
829
827
|
});
|
|
830
828
|
|
package/public/style.css
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
border: 0 !important;
|
|
6
6
|
overflow: hidden !important;
|
|
7
7
|
line-height: 0 !important;
|
|
8
|
+
font-size: 0 !important;
|
|
8
9
|
}
|
|
9
10
|
|
|
10
11
|
.ezoic-ad * {
|
|
@@ -13,9 +14,33 @@
|
|
|
13
14
|
border: 0 !important;
|
|
14
15
|
}
|
|
15
16
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
display: block;
|
|
17
|
+
/* Force enfants directs collés */
|
|
18
|
+
.ezoic-ad > * {
|
|
19
|
+
display: block !important;
|
|
20
|
+
margin: 0 !important;
|
|
21
|
+
padding: 0 !important;
|
|
22
|
+
line-height: 0 !important;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/* Supprimer espace après */
|
|
26
|
+
.ezoic-ad::after,
|
|
27
|
+
.ezoic-ad > *::after {
|
|
28
|
+
content: '' !important;
|
|
29
|
+
display: block !important;
|
|
19
30
|
height: 0 !important;
|
|
20
31
|
margin: 0 !important;
|
|
32
|
+
padding: 0 !important;
|
|
33
|
+
line-height: 0 !important;
|
|
34
|
+
font-size: 0 !important;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/* Cacher divs vides qui créent espace */
|
|
38
|
+
.ezoic-ad > div:empty {
|
|
39
|
+
display: none !important;
|
|
40
|
+
height: 0 !important;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.ezoic-ad > *:empty:not(iframe):not(img):not(ins) {
|
|
44
|
+
display: none !important;
|
|
45
|
+
height: 0 !important;
|
|
21
46
|
}
|