nodebb-plugin-ezoic-infinite 1.8.88 → 1.8.89

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 +4 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodebb-plugin-ezoic-infinite",
3
- "version": "1.8.88",
3
+ "version": "1.8.89",
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
@@ -916,12 +916,14 @@
916
916
  _retries++;
917
917
  patchShowAds();
918
918
 
919
- // Reload sa.min.js only if Ezoic never initialized at all (no loadingStatus).
919
+ // Reload sa.min.js only if Ezoic never initialized at all (no loadingStatus)
920
+ // AND sa.min.js is not already present in the DOM (to avoid duplicates on first load
921
+ // when the script is injected server-side but loadingStatus hasn't been set yet).
920
922
  // Do NOT reload when loadingStatus === 'complete' (post-defineScript-failure):
921
923
  // that would trigger a second defineScript failed error.
922
924
  if (!_scriptReloaded && _retries <= 3) {
923
925
  const ez = window.ezstandalone;
924
- if (!ez?.loadingStatus) {
926
+ if (!ez?.loadingStatus && !document.querySelector('script[src*="sa.min.js"]')) {
925
927
  _scriptReloaded = true;
926
928
  try {
927
929
  const s = document.createElement('script');