nodebb-plugin-ezoic-infinite 1.8.40 → 1.8.42
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/library.js +3 -20
- package/package.json +1 -1
- package/public/client.js +506 -371
package/library.js
CHANGED
|
@@ -141,12 +141,11 @@ const HEAD_PRECONNECTS = [
|
|
|
141
141
|
const EZOIC_SCRIPTS = [
|
|
142
142
|
'<script data-cfasync="false" src="https://cmp.gatekeeperconsent.com/min.js"></script>',
|
|
143
143
|
'<script data-cfasync="false" src="https://the.gatekeeperconsent.com/cmp.min.js"></script>',
|
|
144
|
+
'<script async src="//www.ezojs.com/ezoic/sa.min.js"></script>',
|
|
144
145
|
'<script>',
|
|
145
|
-
'window._ezaq = window._ezaq || {};',
|
|
146
146
|
'window.ezstandalone = window.ezstandalone || {};',
|
|
147
147
|
'ezstandalone.cmd = ezstandalone.cmd || [];',
|
|
148
148
|
'</script>',
|
|
149
|
-
'<script async src="//www.ezojs.com/ezoic/sa.min.js"></script>',
|
|
150
149
|
].join('\n');
|
|
151
150
|
|
|
152
151
|
// ── Hooks ────────────────────────────────────────────────────────────────────
|
|
@@ -174,24 +173,7 @@ plugin.injectEzoicHead = async (data) => {
|
|
|
174
173
|
const settings = await getSettings();
|
|
175
174
|
const uid = data.req?.uid ?? 0;
|
|
176
175
|
const excluded = await isUserExcluded(uid, settings.excludedGroups);
|
|
177
|
-
|
|
178
|
-
if (excluded) {
|
|
179
|
-
// Even for excluded users, inject a minimal stub so that any script
|
|
180
|
-
// referencing ezstandalone doesn't throw a ReferenceError, plus
|
|
181
|
-
// the config with excluded=true so client.js bails early.
|
|
182
|
-
const cfg = buildClientConfig(settings, true);
|
|
183
|
-
const stub = [
|
|
184
|
-
'<script>',
|
|
185
|
-
'window._ezaq = window._ezaq || {};',
|
|
186
|
-
'window.ezstandalone = window.ezstandalone || {};',
|
|
187
|
-
'ezstandalone.cmd = ezstandalone.cmd || [];',
|
|
188
|
-
'</script>',
|
|
189
|
-
].join('\n');
|
|
190
|
-
data.templateData.customHTML =
|
|
191
|
-
stub + '\n' +
|
|
192
|
-
serializeInlineConfig(cfg) +
|
|
193
|
-
(data.templateData.customHTML || '');
|
|
194
|
-
} else {
|
|
176
|
+
if (!excluded) {
|
|
195
177
|
const cfg = buildClientConfig(settings, false);
|
|
196
178
|
data.templateData.customHTML =
|
|
197
179
|
HEAD_PRECONNECTS + '\n' +
|
|
@@ -200,6 +182,7 @@ plugin.injectEzoicHead = async (data) => {
|
|
|
200
182
|
(data.templateData.customHTML || '');
|
|
201
183
|
}
|
|
202
184
|
} catch (err) {
|
|
185
|
+
// Log but don't break rendering
|
|
203
186
|
console.error('[ezoic-infinite] injectEzoicHead error:', err.message);
|
|
204
187
|
}
|
|
205
188
|
return data;
|