nodebb-plugin-ezoic-infinite 1.7.49 → 1.7.50

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 +1 -21
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodebb-plugin-ezoic-infinite",
3
- "version": "1.7.49",
3
+ "version": "1.7.50",
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
@@ -38,7 +38,6 @@
38
38
  const A_CREATED = 'data-ezoic-created'; // timestamp création ms
39
39
  const A_SHOWN = 'data-ezoic-shown'; // timestamp dernier showAds ms
40
40
 
41
- const EMPTY_CHECK_MS = 20_000; // délai avant collapse d'un wrap vide post-show
42
41
  const MAX_INSERTS_RUN = 6; // max insertions par appel runCore
43
42
  const MAX_INFLIGHT = 4; // max showAds() simultanés
44
43
  const SHOW_THROTTLE_MS = 900; // anti-spam showAds() par id
@@ -329,15 +328,11 @@
329
328
  // Délais requis : destroyPlaceholders est asynchrone en interne
330
329
  const doDestroy = () => { try { ez.destroyPlaceholders([id]); } catch (_) {} setTimeout(doDefine, 300); };
331
330
  const doDefine = () => { try { ez.define([id]); } catch (_) {} setTimeout(doDisplay, 300); };
332
- // Fix #4 : re-observer le ph après displayMore pour déclencher scheduleEmptyCheck
333
- // si la pub ne charge pas (détection wrap vide).
334
331
  const doDisplay = () => {
335
332
  try { ez.displayMore([id]); } catch (_) {}
336
333
  S.recycling.delete(id); // Fix #1 : séquence terminée
337
334
  observePh(id);
338
- const t = ts();
339
- try { best.setAttribute(A_SHOWN, String(t)); } catch (_) {}
340
- scheduleEmptyCheck(id, t);
335
+ try { best.setAttribute(A_SHOWN, String(ts())); } catch (_) {}
341
336
  };
342
337
  try { (typeof ez.cmd?.push === 'function') ? ez.cmd.push(doDestroy) : doDestroy(); } catch (_) {}
343
338
 
@@ -511,7 +506,6 @@
511
506
  const ez = window.ezstandalone;
512
507
  const doShow = () => {
513
508
  try { ez.showAds(id); } catch (_) {}
514
- scheduleEmptyCheck(id, t);
515
509
  setTimeout(() => { clearTimeout(timer); release(); }, 700);
516
510
  };
517
511
  Array.isArray(ez.cmd) ? ez.cmd.push(doShow) : doShow();
@@ -519,20 +513,6 @@
519
513
  });
520
514
  }
521
515
 
522
- function scheduleEmptyCheck(id, showTs) {
523
- setTimeout(() => {
524
- try {
525
- const ph = document.getElementById(`${PH_PREFIX}${id}`);
526
- const wrap = ph?.closest?.(`.${WRAP_CLASS}`);
527
- if (!wrap || !ph?.isConnected) return;
528
- if (parseInt(wrap.getAttribute(A_SHOWN) || '0', 10) > showTs) return;
529
- // is-empty désactivé pour ezoic-ad-between : Ezoic peut prendre >20s
530
- // à charger sur liste de catégorie — collapse prématuré des wraps.
531
- if (wrap.classList.contains('ezoic-ad-between')) return;
532
- wrap.classList.toggle('is-empty', !isFilled(ph));
533
- } catch (_) {}
534
- }, EMPTY_CHECK_MS);
535
- }
536
516
 
537
517
  // ── Patch Ezoic showAds ────────────────────────────────────────────────────
538
518
  //