nodebb-plugin-ezoic-infinite 1.4.26 → 1.4.28

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 +14 -14
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodebb-plugin-ezoic-infinite",
3
- "version": "1.4.26",
3
+ "version": "1.4.28",
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
@@ -559,9 +559,11 @@
559
559
  }
560
560
 
561
561
  async function runCore() {
562
+ console.log('[EZOIC DEBUG] runCore démarré, pageKey:', state.pageKey);
562
563
  patchShowAds();
563
564
 
564
565
  const cfg = await fetchConfig();
566
+ console.log('[EZOIC DEBUG] Config récupérée, excluded:', cfg?.excluded);
565
567
  if (!cfg || cfg.excluded) return;
566
568
 
567
569
  initPools(cfg);
@@ -595,6 +597,8 @@
595
597
  }
596
598
  }
597
599
 
600
+ console.log('[EZOIC DEBUG] Inserted:', inserted, 'wrappers');
601
+
598
602
  enforceNoAdjacentAds();
599
603
 
600
604
  // If nothing inserted and list isn't in DOM yet (first click), retry a bit
@@ -645,19 +649,16 @@
645
649
  $(window).on('action:ajaxify.start.ezoicInfinite', () => cleanup());
646
650
 
647
651
  $(window).on('action:ajaxify.end.ezoicInfinite', () => {
652
+ console.log('[EZOIC DEBUG] ajaxify.end déclenché');
648
653
  state.pageKey = getPageKey();
649
654
  ensureObserver();
650
655
 
651
- // Attendre que NodeBB ait fini de construire le DOM
652
- // (ajaxify.end se déclenche avant que le contenu soit vraiment prêt)
653
- setTimeout(() => {
654
- scheduleRun();
655
- }, 800);
656
-
657
- // Second pass pour être sûr
656
+ // Attendre que le DOM soit construit par NodeBB
658
657
  setTimeout(() => {
659
- scheduleRun();
660
- }, 1500);
658
+ console.log('[EZOIC DEBUG] Appel waitForEzoicThenRun après 500ms');
659
+ // Puis attendre que Ezoic soit prêt (comme au chargement initial)
660
+ waitForEzoicThenRun();
661
+ }, 500);
661
662
  });
662
663
 
663
664
  $(window).on('action:category.loaded.ezoicInfinite', () => {
@@ -710,13 +711,11 @@
710
711
 
711
712
  (function check() {
712
713
  attempts++;
714
+ console.log('[EZOIC DEBUG] waitForEzoic attempt', attempts, 'ezstandalone:', !!window.ezstandalone, 'showAds:', typeof window.ezstandalone?.showAds);
715
+
713
716
  // Vérifier si Ezoic est chargé
714
717
  if (window.ezstandalone && typeof window.ezstandalone.showAds === 'function') {
715
- // Diagnostic : afficher les placeholders disponibles
716
- try {
717
- if (window.ezstandalone.placeholders) {
718
- }
719
- } catch (e) {}
718
+ console.log('[EZOIC DEBUG] Ezoic prêt après', attempts, 'tentatives');
720
719
  // Ezoic est prêt → lancer l'insertion
721
720
  scheduleRun();
722
721
  setTimeout(scheduleRun, 300);
@@ -724,6 +723,7 @@
724
723
  }
725
724
  // Ezoic pas encore prêt
726
725
  if (attempts >= maxAttempts) {
726
+ console.warn('[EZOIC DEBUG] Timeout après 10s - Ezoic pas chargé');
727
727
  // Tenter quand même
728
728
  scheduleRun();
729
729
  return;