nodebb-plugin-ezoic-infinite 1.8.6 → 1.8.8
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 +20 -5
- package/public/style.css +9 -0
package/package.json
CHANGED
package/public/client.js
CHANGED
|
@@ -80,15 +80,15 @@
|
|
|
80
80
|
// Tunables (stables en prod)
|
|
81
81
|
const MIN_PRUNE_AGE_MS = 8_000; // délai de grâce avant pruning (stabilisation DOM)
|
|
82
82
|
const MAX_INSERTS_RUN = 10; // plus réactif si NodeBB injecte en rafale
|
|
83
|
-
const MAX_INFLIGHT =
|
|
83
|
+
const MAX_INFLIGHT = 2; // ids max simultanés en vol (garde-fou)
|
|
84
84
|
const MAX_SHOW_BATCH = 4; // ids max par appel showAds(...ids)
|
|
85
|
-
const SHOW_THROTTLE_MS =
|
|
86
|
-
const SHOW_RELEASE_MS =
|
|
85
|
+
const SHOW_THROTTLE_MS = 500; // anti-spam showAds() par id (plus réactif)
|
|
86
|
+
const SHOW_RELEASE_MS = 300; // relâche inflight après showAds() batché
|
|
87
87
|
const SHOW_FAILSAFE_MS = 7000; // relâche forcée si stack pub lente
|
|
88
|
-
const BATCH_FLUSH_MS =
|
|
88
|
+
const BATCH_FLUSH_MS = 30; // micro-buffer pour regrouper les ids proches
|
|
89
89
|
const MAX_DESTROY_BATCH = 4; // ids max par destroyPlaceholders(...ids)
|
|
90
90
|
const DESTROY_FLUSH_MS = 30; // micro-buffer destroy pour lisser les rafales
|
|
91
|
-
const BURST_COOLDOWN_MS =
|
|
91
|
+
const BURST_COOLDOWN_MS = 100; // délai min entre deux déclenchements de burst
|
|
92
92
|
|
|
93
93
|
// Marges IO larges et fixes — observer créé une seule fois au boot
|
|
94
94
|
const IO_MARGIN_DESKTOP = '2500px 0px 2500px 0px';
|
|
@@ -159,6 +159,19 @@
|
|
|
159
159
|
const normBool = v => v === true || v === 'true' || v === 1 || v === '1' || v === 'on';
|
|
160
160
|
const isFilled = n => !!(n?.querySelector?.('iframe, ins, img, video, [data-google-container-id]'));
|
|
161
161
|
|
|
162
|
+
function healFalseEmpty(root = document) {
|
|
163
|
+
try {
|
|
164
|
+
const list = [];
|
|
165
|
+
if (root instanceof Element && root.classList?.contains(WRAP_CLASS)) list.push(root);
|
|
166
|
+
const found = root.querySelectorAll ? root.querySelectorAll(`.${WRAP_CLASS}.is-empty`) : [];
|
|
167
|
+
for (const w of found) list.push(w);
|
|
168
|
+
for (const w of list) {
|
|
169
|
+
if (!w?.classList?.contains('is-empty')) continue;
|
|
170
|
+
if (isFilled(w)) w.classList.remove('is-empty');
|
|
171
|
+
}
|
|
172
|
+
} catch (_) {}
|
|
173
|
+
}
|
|
174
|
+
|
|
162
175
|
function phEl(id) {
|
|
163
176
|
return document.getElementById(`${PH_PREFIX}${id}`);
|
|
164
177
|
}
|
|
@@ -183,6 +196,7 @@
|
|
|
183
196
|
requestAnimationFrame(() => {
|
|
184
197
|
S.sweepQueued = false;
|
|
185
198
|
sweepDeadWraps();
|
|
199
|
+
healFalseEmpty();
|
|
186
200
|
});
|
|
187
201
|
}
|
|
188
202
|
|
|
@@ -928,6 +942,7 @@ function startShowBatch(ids) {
|
|
|
928
942
|
if (sawWrapRemoval) queueSweepDeadWraps();
|
|
929
943
|
for (const n of m.addedNodes) {
|
|
930
944
|
if (n.nodeType !== 1) continue;
|
|
945
|
+
try { healFalseEmpty(n); } catch (_) {}
|
|
931
946
|
// matches() d'abord (O(1)), querySelector() seulement si nécessaire
|
|
932
947
|
if (allSel.some(s => { try { return n.matches(s); } catch(_){return false;} }) ||
|
|
933
948
|
allSel.some(s => { try { return !!n.querySelector(s); } catch(_){return false;} })) {
|
package/public/style.css
CHANGED
|
@@ -61,3 +61,12 @@
|
|
|
61
61
|
margin: 0 !important;
|
|
62
62
|
padding: 0 !important;
|
|
63
63
|
}
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
/* Filet anti faux-empty : si la pub est rendue, ne pas laisser le wrap replié */
|
|
67
|
+
.nodebb-ezoic-wrap.is-empty:has(iframe, [data-google-container-id], [id^="google_ads_iframe_"]) {
|
|
68
|
+
height: auto !important;
|
|
69
|
+
min-height: 1px !important;
|
|
70
|
+
max-height: none !important;
|
|
71
|
+
overflow: visible !important;
|
|
72
|
+
}
|