nodebb-plugin-ezoic-infinite 1.7.66 → 1.7.68

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 +7 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodebb-plugin-ezoic-infinite",
3
- "version": "1.7.66",
3
+ "version": "1.7.68",
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
@@ -18,7 +18,10 @@
18
18
  * v64 recycleAndMove supprimé (slots restaient en 'unused' après destroy).
19
19
  * v67 define(allIds) au boot — Ezoic enregistre tous les slots en interne.
20
20
  * v68 setIsSinglePageApplication(true) + newPage() à chaque navigation.
21
- * v69 Nettoyage prod final : S.recycling orphelin supprimé, helpers Ezoic
21
+ * v69 scheduleEmptyCheck déplacé dans startShow (après showAds, comme v50).
22
+ * IO_MARGIN réduit (800px/1200px) : évite que AMP charge une pub trop
23
+ * tôt et la retire immédiatement car déjà hors viewport au chargement.
24
+ * Nettoyage prod final : S.recycling orphelin supprimé, helpers Ezoic
22
25
  * SPA extraits en fonctions dédiées, commentaires legacy retirés.
23
26
  */
24
27
  (function nbbEzoicInfinite() {
@@ -37,8 +40,8 @@
37
40
  const SHOW_THROTTLE_MS = 900; // anti-spam showAds() par id
38
41
  const BURST_COOLDOWN_MS = 200; // délai min entre deux bursts
39
42
 
40
- const IO_MARGIN_DESKTOP = '2500px 0px 2500px 0px';
41
- const IO_MARGIN_MOBILE = '3500px 0px 3500px 0px';
43
+ const IO_MARGIN_DESKTOP = '800px 0px 800px 0px';
44
+ const IO_MARGIN_MOBILE = '1200px 0px 1200px 0px';
42
45
 
43
46
  const SEL = {
44
47
  post: '[component="post"][data-pid]',
@@ -278,7 +281,6 @@
278
281
  mutate(() => el.insertAdjacentElement('afterend', w));
279
282
  S.mountedIds.add(id);
280
283
  S.wrapByKey.set(key, w);
281
- scheduleEmptyCheck(id);
282
284
  return w;
283
285
  }
284
286
 
@@ -407,6 +409,7 @@
407
409
  try { ph.closest?.(`.${WRAP_CLASS}`)?.classList.remove('is-empty'); } catch (_) {}
408
410
  ezCmd(ez => {
409
411
  try { ez.showAds(id); } catch (_) {}
412
+ scheduleEmptyCheck(id);
410
413
  setTimeout(() => { clearTimeout(timer); release(); }, 700);
411
414
  });
412
415
  } catch (_) { clearTimeout(timer); release(); }