nodebb-plugin-ezoic-infinite 1.8.22 → 1.8.23

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 +2 -40
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodebb-plugin-ezoic-infinite",
3
- "version": "1.8.22",
3
+ "version": "1.8.23",
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
@@ -582,42 +582,7 @@
582
582
  return S.io;
583
583
  }
584
584
 
585
- function patchShowAds() {
586
- const install = () => {
587
- try {
588
- window.ezstandalone = window.ezstandalone || {};
589
- const ez = window.ezstandalone;
590
- if (window.__nbbEzPatchedV22 || typeof ez.showAds !== 'function') return;
591
- window.__nbbEzPatchedV22 = true;
592
- const orig = ez.showAds.bind(ez);
593
- ez.showAds = function (...args) {
594
- if (isBlocked()) return;
595
- const ids = (args.length === 1 && Array.isArray(args[0])) ? args[0] : args;
596
- const valid = [];
597
- const seen = new Set();
598
- for (const v of ids) {
599
- const id = parseInt(v, 10);
600
- if (!Number.isFinite(id) || id <= 0 || seen.has(id)) continue;
601
- const ph = phEl(id);
602
- if (!ph?.isConnected) continue;
603
- const wrap = ph.closest?.(`.${WRAP_CLASS}`);
604
- if (!wrap?.isConnected) continue;
605
- const rec = ensureRegistry(id, wrap);
606
- if (rec.cooldownUntil && now() < rec.cooldownUntil && (now() - (rec.shownAt || 0)) < 500) continue;
607
- seen.add(id);
608
- valid.push(id);
609
- }
610
- if (!valid.length) return;
611
- try { return orig(...valid); } catch (_) { try { return orig(valid); } catch (_) {} }
612
- };
613
- } catch (_) {}
614
- };
615
- install();
616
- if (!window.__nbbEzPatchedV22) {
617
- window.ezstandalone = window.ezstandalone || {};
618
- (window.ezstandalone.cmd = window.ezstandalone.cmd || []).push(install);
619
- }
620
- }
585
+
621
586
 
622
587
  function healFalseEmpty(root) {
623
588
  try {
@@ -714,7 +679,6 @@
714
679
 
715
680
  async function runCore() {
716
681
  if (isBlocked()) return 0;
717
- patchShowAds();
718
682
  const cfg = await fetchConfig();
719
683
  if (!cfg || cfg.excluded) return 0;
720
684
  initPools(cfg);
@@ -782,8 +746,7 @@
782
746
  S.blockedUntil = 0;
783
747
  ensureTcfLocator();
784
748
  warmNetwork();
785
- patchShowAds();
786
- getIO();
749
+ getIO();
787
750
  ensureObserver();
788
751
  scheduleRun();
789
752
  });
@@ -822,7 +785,6 @@
822
785
  S.pageKey = pageKey();
823
786
  ensureTcfLocator();
824
787
  warmNetwork();
825
- patchShowAds();
826
788
  getIO();
827
789
  ensureObserver();
828
790
  bindNodeBB();