nodebb-plugin-ezoic-infinite 1.8.79 → 1.8.81

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodebb-plugin-ezoic-infinite",
3
- "version": "1.8.79",
3
+ "version": "1.8.81",
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);
@@ -659,7 +664,7 @@
659
664
  }
660
665
  S.burstCount++;
661
666
  scheduleRun(n => {
662
- if (!n && !S.pending.length) { S.burstActive = false; return; }
667
+ if (!n && !S.pending.size) { S.burstActive = false; return; }
663
668
  setTimeout(step, n > 0 ? 150 : 300);
664
669
  });
665
670
  };
@@ -30,7 +30,7 @@
30
30
  <p class="form-text">Insère des pubs entre les catégories sur la page d’accueil (liste des catégories).</p>
31
31
 
32
32
  <div class="form-check mb-3">
33
- <input class="form-check-input" type="checkbox" id="enableCategoryAds" name="enableCategoryAds">
33
+ <input class="form-check-input" type="checkbox" id="enableCategoryAds" name="enableCategoryAds" {enableCategoryAds_checked}>
34
34
  <label class="form-check-label" for="enableCategoryAds">Activer les pubs entre les catégories</label>
35
35
  <div class="form-check mt-2">
36
36
  <input class="form-check-input" type="checkbox" name="showFirstCategoryAd" {showFirstCategoryAd_checked} />