nodebb-plugin-ezoic-infinite 1.4.41 → 1.4.43

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 +10 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodebb-plugin-ezoic-infinite",
3
- "version": "1.4.41",
3
+ "version": "1.4.43",
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
@@ -335,6 +335,7 @@
335
335
  try {
336
336
  window.ezstandalone = window.ezstandalone || {};
337
337
  if (typeof window.ezstandalone.showAds === 'function') {
338
+
338
339
  state.lastShowById.set(id, Date.now());
339
340
  window.ezstandalone.showAds(id);
340
341
  return true;
@@ -354,6 +355,15 @@
354
355
  attempts += 1;
355
356
  const el = document.getElementById(phId);
356
357
  if (el && el.isConnected) {
358
+ // CRITIQUE: Vérifier que le placeholder est VISIBLE
359
+ // Ezoic refuse les placeholders invisibles (offsetHeight = 0)
360
+ if (el.offsetHeight === 0 && attempts < 100) {
361
+ // Pas encore visible, réessayer
362
+ const timeoutId = setTimeout(waitForPh, 50);
363
+ state.activeTimeouts.add(timeoutId);
364
+ return;
365
+ }
366
+
357
367
  // Double-check pageKey juste avant doCall (au cas où cleanup appelé entre-temps)
358
368
  if (state.pageKey !== startPageKey) {
359
369
  // Note: les timeouts seront nettoyés par cleanup()