nodebb-plugin-ezoic-infinite 1.7.57 → 1.7.58

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/public/client.js +3 -8
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodebb-plugin-ezoic-infinite",
3
- "version": "1.7.57",
3
+ "version": "1.7.58",
4
4
  "description": "Production-ready Ezoic infinite ads integration for NodeBB 4.x",
5
5
  "main": "library.js",
6
6
  "license": "MIT",
package/public/client.js CHANGED
@@ -41,7 +41,6 @@
41
41
  const A_WRAPID = 'data-ezoic-wrapid'; // id Ezoic
42
42
 
43
43
  const EMPTY_CHECK_MS = 60_000;
44
- const RECYCLE_MIN_AGE_MS = 30_000; // délai minimal avant recyclage d'un wrap rempli // délai avant collapse wrap vide (60s — laisser le temps au CMP/enchères)
45
44
  const MAX_INSERTS_RUN = 6; // insertions max par appel runCore
46
45
  const MAX_INFLIGHT = 4; // showAds() simultanés max
47
46
  const SHOW_THROTTLE_MS = 900; // anti-spam showAds() par id
@@ -258,7 +257,7 @@
258
257
  typeof ez?.define !== 'function' ||
259
258
  typeof ez?.displayMore !== 'function') return null;
260
259
 
261
- const threshold = -(window.innerHeight || 800);
260
+ const threshold = -3 * (window.innerHeight || 800);
262
261
  let bestEmpty = null, bestEmptyBottom = Infinity;
263
262
  let bestFilled = null, bestFilledBottom = Infinity;
264
263
 
@@ -279,11 +278,6 @@
279
278
  const id = parseInt(best.getAttribute(A_WRAPID), 10);
280
279
  if (!Number.isFinite(id)) return null;
281
280
  if (S.recycling.has(id)) return null;
282
- // Ne pas recycler un wrap rempli depuis moins de RECYCLE_MIN_AGE_MS
283
- if (best === bestFilled) {
284
- const filledAt = parseInt(best.getAttribute('data-ezoic-filled') || '0', 10);
285
- if (ts() - filledAt < RECYCLE_MIN_AGE_MS) return null;
286
- }
287
281
  S.recycling.add(id);
288
282
 
289
283
  const oldKey = best.getAttribute(A_ANCHOR);
@@ -466,7 +460,8 @@
466
460
  if (t - (S.lastShow.get(id) ?? 0) < SHOW_THROTTLE_MS) { clearTimeout(timer); return release(); }
467
461
  S.lastShow.set(id, t);
468
462
  // Marquer le wrap avec le timestamp de fill pour bloquer le recyclage
469
- try { const w = document.getElementById(`${PH_PREFIX}${id}`)?.closest?.(`.${WRAP_CLASS}`); if (w) { w.setAttribute('data-ezoic-filled', String(t)); w.classList.remove('is-empty'); } } catch (_) {}
463
+ // Si la pub charge après is-empty, retirer le collapse
464
+ try { document.getElementById(`${PH_PREFIX}${id}`)?.closest?.(`.${WRAP_CLASS}`)?.classList.remove('is-empty'); } catch (_) {}
470
465
  window.ezstandalone = window.ezstandalone || {};
471
466
  const ez = window.ezstandalone;
472
467
  const doShow = () => {