nodebb-plugin-ezoic-infinite 1.8.58 → 1.8.60

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/library.js +3 -14
  2. package/package.json +1 -1
package/library.js CHANGED
@@ -153,7 +153,7 @@ const EZOIC_SCRIPTS = [
153
153
 
154
154
  // Analytics
155
155
  '<script src="https://ezoicanalytics.com/analytics.js"></script>',
156
- ].join('\n');
156
+ ].join('\n') + '\n';
157
157
 
158
158
  // ── Hooks ────────────────────────────────────────────────────────────────────
159
159
 
@@ -173,24 +173,13 @@ plugin.addAdminNavigation = async (header) => {
173
173
 
174
174
  plugin.injectEzoicHead = async (data) => {
175
175
  try {
176
- const req = data.req;
177
-
178
- // ✅ NodeBB = SPA (ajaxify). Ne pas ré-injecter les scripts Ezoic sur les requêtes XHR.
179
- const isXHR =
180
- !!(req && (req.xhr || String(req.headers?.['x-requested-with']).toLowerCase() === 'xmlhttprequest'));
181
-
182
- if (isXHR) return data;
183
-
184
176
  const settings = await getSettings();
185
- const uid = req?.uid ?? 0;
177
+ const uid = data.req?.uid ?? 0;
186
178
  const excluded = await isUserExcluded(uid, settings.excludedGroups);
187
-
188
179
  if (!excluded) {
189
- const existing = data.templateData.customHTML || '';
190
- data.templateData.customHTML = EZOIC_SCRIPTS + existing;
180
+ data.templateData.customHTML = EZOIC_SCRIPTS + data.templateData.customHTML || '';
191
181
  }
192
182
  } catch (_) {}
193
-
194
183
  return data;
195
184
  };
196
185
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodebb-plugin-ezoic-infinite",
3
- "version": "1.8.58",
3
+ "version": "1.8.60",
4
4
  "description": "Production-ready Ezoic infinite ads integration for NodeBB 4.x",
5
5
  "main": "library.js",
6
6
  "license": "MIT",