nodebb-plugin-ezoic-infinite 1.7.74 → 1.7.76
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 +12 -17
package/package.json
CHANGED
package/public/client.js
CHANGED
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
const A_ANCHOR = 'data-ezoic-anchor'; // "kindClass:stableId"
|
|
35
35
|
const A_WRAPID = 'data-ezoic-wrapid'; // id Ezoic
|
|
36
36
|
|
|
37
|
-
const EMPTY_CHECK_MS =
|
|
37
|
+
const EMPTY_CHECK_MS = 15_000; // collapse wrap vide 15s après showAds
|
|
38
38
|
const MAX_INSERTS_RUN = 6; // insertions max par appel runCore
|
|
39
39
|
const MAX_INFLIGHT = 4; // showAds() simultanés max
|
|
40
40
|
const SHOW_THROTTLE_MS = 900; // anti-spam showAds() par id
|
|
@@ -280,28 +280,19 @@
|
|
|
280
280
|
}
|
|
281
281
|
|
|
282
282
|
function watchFill(id, wrap) {
|
|
283
|
-
//
|
|
284
|
-
//
|
|
285
|
-
//
|
|
283
|
+
// Détecte une vraie pub dans le placeholder, y compris iframes AMP cross-origin.
|
|
284
|
+
// On surveille les mutations — dès qu'une iframe ou ins apparaît, on marque filled.
|
|
285
|
+
// Les no-fills (containers height:0) sont gérés par scheduleEmptyCheck.
|
|
286
286
|
const ph = document.getElementById(`${PH_PREFIX}${id}`);
|
|
287
287
|
if (!ph) return;
|
|
288
288
|
const check = () => {
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
const containers = ph.querySelectorAll('[id*="__container__"]');
|
|
293
|
-
for (const c of containers) {
|
|
294
|
-
const h = parseInt(c.style.height, 10);
|
|
295
|
-
if (h > 0) { wrap.setAttribute('data-ez-filled', '1'); obs.disconnect(); return; }
|
|
296
|
-
}
|
|
297
|
-
// container présent mais height:0 = no-fill confirmé → is-empty
|
|
298
|
-
if (containers.length > 0) {
|
|
299
|
-
const allZero = [...containers].every(c => parseInt(c.style.height, 10) === 0);
|
|
300
|
-
if (allZero) { wrap.classList.add('is-empty'); obs.disconnect(); }
|
|
289
|
+
if (ph.querySelector('iframe, ins')) {
|
|
290
|
+
wrap.setAttribute('data-ez-filled', '1');
|
|
291
|
+
obs.disconnect();
|
|
301
292
|
}
|
|
302
293
|
};
|
|
303
294
|
const obs = new MutationObserver(check);
|
|
304
|
-
obs.observe(ph, { childList: true, subtree: true
|
|
295
|
+
obs.observe(ph, { childList: true, subtree: true });
|
|
305
296
|
}
|
|
306
297
|
|
|
307
298
|
function insertAfter(el, id, klass, key) {
|
|
@@ -396,6 +387,10 @@
|
|
|
396
387
|
const ph = document.getElementById(`${PH_PREFIX}${id}`);
|
|
397
388
|
const wrap = ph?.closest?.(`.${WRAP_CLASS}`);
|
|
398
389
|
if (!wrap || !ph?.isConnected) return;
|
|
390
|
+
// Ne pas colapser si le wrap a une hauteur visible (pub AMP cross-origin)
|
|
391
|
+
if (wrap.offsetHeight > 10) return;
|
|
392
|
+
// Ne pas colapser si data-ez-filled (pub détectée par watchFill)
|
|
393
|
+
if (wrap.getAttribute('data-ez-filled')) return;
|
|
399
394
|
if (!isFilled(wrap)) wrap.classList.add('is-empty');
|
|
400
395
|
} catch (_) {}
|
|
401
396
|
}, EMPTY_CHECK_MS);
|