nodebb-plugin-ezoic-infinite 1.7.68 → 1.7.70

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 +7 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodebb-plugin-ezoic-infinite",
3
- "version": "1.7.68",
3
+ "version": "1.7.70",
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
@@ -40,8 +40,10 @@
40
40
  const SHOW_THROTTLE_MS = 900; // anti-spam showAds() par id
41
41
  const BURST_COOLDOWN_MS = 200; // délai min entre deux bursts
42
42
 
43
- const IO_MARGIN_DESKTOP = '800px 0px 800px 0px';
44
- const IO_MARGIN_MOBILE = '1200px 0px 1200px 0px';
43
+ // Marge asymétrique : précharge 1200px en bas, 0px en haut.
44
+ // Évite que AMP charge une pub déjà sortie du viewport vers le haut.
45
+ const IO_MARGIN_DESKTOP = '0px 0px 1200px 0px';
46
+ const IO_MARGIN_MOBILE = '0px 0px 1500px 0px';
45
47
 
46
48
  const SEL = {
47
49
  post: '[component="post"][data-pid]',
@@ -96,7 +98,9 @@
96
98
  const isMobile = () => { try { return window.innerWidth < 768; } catch (_) { return false; } };
97
99
  const _BOOL_TRUE = new Set([true, 'true', 1, '1', 'on']);
98
100
  const normBool = v => _BOOL_TRUE.has(v);
99
- const isFilled = n => !!(n?.querySelector('iframe, ins, img, video, [data-google-container-id]'));
101
+ // isFilled : exclut l'img reportline Ezoic (ezoicbwa.png) — faux positif
102
+ const isFilled = n => !!(n?.querySelector('iframe, ins, video, [data-google-container-id]'))
103
+ || !!(n?.querySelector('img:not([src*="ezoicbwa"]):not([src*="ezodn.com"])'));
100
104
 
101
105
  function mutate(fn) {
102
106
  S.mutGuard++;