nodebb-plugin-ezoic-infinite 1.4.77 → 1.4.78

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 +19 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodebb-plugin-ezoic-infinite",
3
- "version": "1.4.77",
3
+ "version": "1.4.78",
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
@@ -611,13 +611,28 @@
611
611
  }
612
612
 
613
613
  function cleanup() {
614
- destroyUsedPlaceholders();
615
-
616
- // CRITIQUE: Annuler batch showAds en attente pour éviter erreurs console
614
+ // CRITIQUE: Détruire TOUS les placeholders Ezoic AVANT de supprimer DOM
615
+ // Pour annuler la queue interne d'Ezoic
616
+ const allWrappers = document.querySelectorAll('.ezoic-ad');
617
+ const allIds = [];
618
+ allWrappers.forEach(wrapper => {
619
+ const ph = wrapper.querySelector('[id^="ezoic-pub-ad-placeholder-"]');
620
+ if (ph) {
621
+ const match = ph.id.match(/\d+/);
622
+ if (match) allIds.push(parseInt(match[0]));
623
+ }
624
+ });
625
+
626
+ if (allIds.length > 0) {
627
+ destroyPlaceholderIds(allIds); // Dire à Ezoic d'arrêter
628
+ }
629
+
630
+ // Annuler batch showAds en attente
617
631
  pendingShowAdsIds.clear();
618
632
  clearTimeout(batchShowAdsTimer);
619
633
 
620
- document.querySelectorAll('.ezoic-ad').forEach(el => {
634
+ // Maintenant supprimer DOM
635
+ allWrappers.forEach(el => {
621
636
  try { el.remove(); } catch (e) {}
622
637
  });
623
638