nodebb-plugin-ezoic-infinite 1.8.80 → 1.8.82

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/library.js CHANGED
@@ -155,7 +155,11 @@ const HEAD_PRECONNECTS = [
155
155
  // async on sa.min.js caused "Timed out waiting for loadingStatus LOADING"
156
156
  // because it could execute before CMP was ready.
157
157
  // analytics.js provides Ezoic analytics integration.
158
+ // __tcfapiLocator must exist before the CMP scripts initialize so that
159
+ // Ezoic's TCF cross-frame channel is ready when sa.min.js calls defineScript.
160
+ // Without it the CMP fails to register consent and defineScript throws.
158
161
  const EZOIC_SCRIPTS = [
162
+ '<script data-cfasync="false">(function(){if(document.getElementById("__tcfapiLocator"))return;var f=document.createElement("iframe");f.style.display="none";f.id=f.name="__tcfapiLocator";(document.head||document.documentElement).appendChild(f);}())</script>',
159
163
  '<script data-cfasync="false" src="https://cmp.gatekeeperconsent.com/min.js"></script>',
160
164
  '<script data-cfasync="false" src="https://the.gatekeeperconsent.com/cmp.min.js"></script>',
161
165
  '<script src="//www.ezojs.com/ezoic/sa.min.js"></script>',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodebb-plugin-ezoic-infinite",
3
- "version": "1.8.80",
3
+ "version": "1.8.82",
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
@@ -29,8 +29,8 @@
29
29
  RECYCLE_MIN_AGE_MS: 8_000,
30
30
  SHOW_THROTTLE_MS: 500,
31
31
  BURST_COOLDOWN_MS: 200,
32
- BLOCK_DURATION_MS: 1_500,
33
- SHOW_TIMEOUT_MS: 7_000,
32
+ BLOCK_DURATION_MS: 1_000,
33
+ SHOW_TIMEOUT_MS: 4_500,
34
34
  SHOW_RELEASE_MS: 700,
35
35
  RECYCLE_DELAY_MS: 300,
36
36
  UNCOLLAPSE_CHECK_MS: [500, 3_000, 10_000],
@@ -353,7 +353,7 @@
353
353
  });
354
354
  if (oldKey && S.wrapByKey.get(oldKey) === best) S.wrapByKey.delete(oldKey);
355
355
  S.wrapByKey.set(newKey, best);
356
- setTimeout(() => { observePh(id); enqueueShow(id); }, TIMING.RECYCLE_DELAY_MS);
356
+ requestAnimationFrame(() => { observePh(id); enqueueShow(id); });
357
357
  }, TIMING.RECYCLE_DELAY_MS);
358
358
  };
359
359
 
@@ -604,10 +604,15 @@
604
604
 
605
605
  // ── Core ───────────────────────────────────────────────────────────────────
606
606
 
607
+ let _lastGc = 0;
608
+
607
609
  async function runCore() {
608
610
  if (isBlocked()) return 0;
609
611
  patchShowAds();
610
612
 
613
+ const t = now();
614
+ if (t - _lastGc > 30_000) { _lastGc = t; gcDisconnectedWraps(); }
615
+
611
616
  const cfg = await fetchConfig();
612
617
  if (!cfg || cfg.excluded) return 0;
613
618
  initPools(cfg);