nodebb-plugin-ezoic-infinite 1.8.82 → 1.8.83

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
@@ -162,7 +162,7 @@ const EZOIC_SCRIPTS = [
162
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>',
163
163
  '<script data-cfasync="false" src="https://cmp.gatekeeperconsent.com/min.js"></script>',
164
164
  '<script data-cfasync="false" src="https://the.gatekeeperconsent.com/cmp.min.js"></script>',
165
- '<script src="//www.ezojs.com/ezoic/sa.min.js"></script>',
165
+ '<script data-cfasync="false" src="//www.ezojs.com/ezoic/sa.min.js"></script>',
166
166
  '<script src="//ezoicanalytics.com/analytics.js"></script>',
167
167
  ].join('\n');
168
168
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodebb-plugin-ezoic-infinite",
3
- "version": "1.8.82",
3
+ "version": "1.8.83",
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
@@ -813,6 +813,8 @@
813
813
  'Error in custom getTCData',
814
814
  'no interstitial API',
815
815
  'JS-Enable should only',
816
+ 'defineScript failed',
817
+ 'failed defineScript',
816
818
  ].map(esc).join('|'));
817
819
  })();
818
820
 
@@ -915,14 +917,16 @@
915
917
  _retries++;
916
918
  patchShowAds();
917
919
 
918
- // Detect Ezoic failed state and reload sa.min.js once to recover
920
+ // Reload sa.min.js only if Ezoic never initialized at all (no loadingStatus).
921
+ // Do NOT reload when loadingStatus === 'complete' (post-defineScript-failure):
922
+ // that would trigger a second defineScript failed error.
919
923
  if (!_scriptReloaded && _retries <= 3) {
920
924
  const ez = window.ezstandalone;
921
- const status = ez?.loadingStatus;
922
- if (status && status !== 'LOADED' && status !== 'LOADING') {
925
+ if (!ez?.loadingStatus) {
923
926
  _scriptReloaded = true;
924
927
  try {
925
928
  const s = document.createElement('script');
929
+ s.setAttribute('data-cfasync', 'false');
926
930
  s.src = '//www.ezojs.com/ezoic/sa.min.js';
927
931
  document.head.appendChild(s);
928
932
  } catch (_) {}