nodebb-plugin-ezoic-infinite 1.4.78 → 1.4.79

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 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodebb-plugin-ezoic-infinite",
3
- "version": "1.4.78",
3
+ "version": "1.4.79",
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
@@ -7,6 +7,9 @@
7
7
  categoryItem: 'li[component="categories/category"]',
8
8
  }, WRAP_CLASS = 'ezoic-ad';
9
9
  const PLACEHOLDER_PREFIX = 'ezoic-pub-ad-placeholder-', MAX_INSERTS_PER_RUN = 3;
10
+
11
+ // FLAG GLOBAL: Bloquer Ezoic pendant navigation
12
+ let EZOIC_BLOCKED = false;
10
13
 
11
14
  const sessionDefinedIds = new Set();
12
15
 
@@ -283,7 +286,12 @@
283
286
  const orig = ez.showAds;
284
287
 
285
288
  ez.showAds = function (arg) {
286
- // CRITIQUE: Filtrer IDs dont placeholders n'existent pas
289
+ // CRITIQUE: Bloquer TOUS appels si navigation en cours
290
+ if (EZOIC_BLOCKED) {
291
+ return; // Ignorer complètement
292
+ }
293
+
294
+ // Filtrer IDs dont placeholders n'existent pas
287
295
  const filterValidIds = (ids) => {
288
296
  return ids.filter(id => {
289
297
  const phId = `ezoic-pub-ad-placeholder-${id}`;
@@ -611,7 +619,10 @@
611
619
  }
612
620
 
613
621
  function cleanup() {
614
- // CRITIQUE: Détruire TOUS les placeholders Ezoic AVANT de supprimer DOM
622
+ // CRITIQUE: BLOQUER Ezoic immédiatement
623
+ EZOIC_BLOCKED = true;
624
+
625
+ // Détruire TOUS les placeholders Ezoic AVANT de supprimer DOM
615
626
  // Pour annuler la queue interne d'Ezoic
616
627
  const allWrappers = document.querySelectorAll('.ezoic-ad');
617
628
  const allIds = [];
@@ -758,6 +769,12 @@
758
769
 
759
770
  $(window).on('action:ajaxify.end.ezoicInfinite', () => {
760
771
  state.pageKey = getPageKey();
772
+
773
+ // Débloquer Ezoic après délai pour laisser DOM se stabiliser
774
+ setTimeout(() => {
775
+ EZOIC_BLOCKED = false;
776
+ }, 200);
777
+
761
778
  ensureObserver();
762
779
 
763
780
  state.canShowAds = true;