nodebb-plugin-ezoic-infinite 1.8.44 → 1.8.45

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 +8 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodebb-plugin-ezoic-infinite",
3
- "version": "1.8.44",
3
+ "version": "1.8.45",
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
@@ -1,5 +1,5 @@
1
1
  /**
2
- * NodeBB Ezoic Infinite Ads — client.js v3.0.0
2
+ * NodeBB Ezoic Infinite Ads — client.js v3.0.1
3
3
  *
4
4
  * Ezoic API usage per official docs:
5
5
  * https://docs.ezoic.com/docs/ezoicads/dynamic-content/
@@ -33,7 +33,9 @@
33
33
  SHOW_THROTTLE_MS: 900,
34
34
  BURST_COOLDOWN_MS: 200,
35
35
  BLOCK_DURATION_MS: 1_500,
36
- BATCH_FLUSH_MS: 120,
36
+ // Batch Ezoic API calls a bit more aggressively on SPA transitions.
37
+ // This reduces early collector calls (e.g. samo.go) during ajaxify route swaps.
38
+ BATCH_FLUSH_MS: 500,
37
39
  RECYCLE_DESTROY_MS: 300,
38
40
  RECYCLE_SHOW_MS: 300,
39
41
  };
@@ -63,7 +65,8 @@
63
65
 
64
66
  const FILL_SEL = 'iframe, ins, img, video, [data-google-container-id], div[id$="__container__"]';
65
67
 
66
- const RECYCLE_MIN_AGE_MS = 5_000;
68
+ // Reduce "ad popping" from aggressive ID recycling.
69
+ const RECYCLE_MIN_AGE_MS = 20_000;
67
70
 
68
71
  // ── Utility ────────────────────────────────────────────────────────────────
69
72
 
@@ -381,7 +384,8 @@
381
384
  typeof ez?.showAds !== 'function') return null;
382
385
 
383
386
  const vh = window.innerHeight || 800;
384
- const threshold = -(3 * vh);
387
+ // Recycle only when the wrap is well above the viewport to avoid visible jumps.
388
+ const threshold = -(6 * vh);
385
389
  const t = now();
386
390
  let bestEmpty = null, bestEmptyY = Infinity;
387
391
  let bestFull = null, bestFullY = Infinity;