nodebb-plugin-ezoic-infinite 1.4.87 → 1.4.89
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.
- package/package.json +1 -1
- package/public/client.js +31 -8
package/package.json
CHANGED
package/public/client.js
CHANGED
|
@@ -147,25 +147,48 @@
|
|
|
147
147
|
const ph = wrapper.querySelector('[id^="ezoic-pub-ad-placeholder-"]');
|
|
148
148
|
if (!ph) return;
|
|
149
149
|
|
|
150
|
-
//
|
|
151
|
-
// CRITIQUE: Ne JAMAIS toucher au placeholder ou ses enfants
|
|
150
|
+
// ULTRA-AGRESSIF: Supprimer TOUT sauf placeholder
|
|
152
151
|
Array.from(wrapper.children).forEach(child => {
|
|
153
|
-
|
|
154
|
-
if (child === ph) return;
|
|
155
|
-
if (child.contains(ph)) return;
|
|
152
|
+
if (child === ph || child.contains(ph)) return;
|
|
156
153
|
if (child.id && child.id.startsWith('ezoic-pub-ad-placeholder-')) return;
|
|
157
|
-
|
|
158
|
-
// Supprimer le reste
|
|
159
154
|
child.remove();
|
|
160
155
|
});
|
|
161
156
|
|
|
162
|
-
// Forcer wrapper
|
|
157
|
+
// Forcer wrapper collé
|
|
163
158
|
wrapper.style.height = 'auto';
|
|
164
159
|
wrapper.style.overflow = 'hidden';
|
|
165
160
|
wrapper.style.lineHeight = '0';
|
|
161
|
+
wrapper.style.fontSize = '0';
|
|
162
|
+
wrapper.style.margin = '0';
|
|
163
|
+
wrapper.style.padding = '0';
|
|
164
|
+
|
|
165
|
+
// CRITIQUE: Forcer suppression margin sur TOUS les .ezoic-ad enfants
|
|
166
|
+
// Pour overrider les margin-top/bottom:15px !important d'Ezoic
|
|
167
|
+
wrapper.querySelectorAll('.ezoic-ad, span.ezoic-ad').forEach(ezSpan => {
|
|
168
|
+
ezSpan.style.setProperty('margin-top', '0', 'important');
|
|
169
|
+
ezSpan.style.setProperty('margin-bottom', '0', 'important');
|
|
170
|
+
ezSpan.style.setProperty('margin-left', '0', 'important');
|
|
171
|
+
ezSpan.style.setProperty('margin-right', '0', 'important');
|
|
172
|
+
});
|
|
173
|
+
|
|
174
|
+
// Nettoyer aussi DANS le placeholder
|
|
175
|
+
if (ph) {
|
|
176
|
+
Array.from(ph.children).forEach(child => {
|
|
177
|
+
// Garder seulement iframe, ins, img
|
|
178
|
+
const tag = child.tagName;
|
|
179
|
+
if (tag !== 'IFRAME' && tag !== 'INS' && tag !== 'IMG' && tag !== 'DIV') {
|
|
180
|
+
child.remove();
|
|
181
|
+
}
|
|
182
|
+
});
|
|
183
|
+
}
|
|
166
184
|
});
|
|
167
185
|
} catch (e) {}
|
|
168
186
|
}
|
|
187
|
+
|
|
188
|
+
// Lancer cleanup périodique toutes les 2s
|
|
189
|
+
setInterval(() => {
|
|
190
|
+
try { cleanupInvisibleEzoicElements(); } catch (e) {}
|
|
191
|
+
}, 2000);
|
|
169
192
|
|
|
170
193
|
function cleanupEmptyWrappers() {
|
|
171
194
|
try {
|