nodebb-plugin-ezoic-infinite 1.8.69 → 1.8.71
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 +17 -21
- package/package.json +1 -1
package/library.js
CHANGED
|
@@ -135,15 +135,18 @@ const HEAD_PRECONNECTS = [
|
|
|
135
135
|
'<link rel="dns-prefetch" href="https://securepubads.g.doubleclick.net">',
|
|
136
136
|
].join('\n');
|
|
137
137
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
138
|
+
// Exact v50 script block — DO NOT change order or attributes.
|
|
139
|
+
// The inline stub AFTER sa.min.js is required: client.js uses ezstandalone.cmd
|
|
140
|
+
// before sa.min.js may have initialized it. _ezaq is NOT stubbed — sa.min.js
|
|
141
|
+
// defines it itself and pre-defining it can change Ezoic's init path.
|
|
142
|
+
const EZOIC_SCRIPTS = `<script data-cfasync="false" src="https://cmp.gatekeeperconsent.com/min.js"></script>
|
|
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>
|
|
145
|
+
<script src="//ezoicanalytics.com/analytics.js"></script>
|
|
146
|
+
<script>
|
|
147
|
+
window.ezstandalone = window.ezstandalone || {};
|
|
148
|
+
ezstandalone.cmd = ezstandalone.cmd || [];
|
|
149
|
+
</script>`;
|
|
147
150
|
|
|
148
151
|
// ── Hooks ────────────────────────────────────────────────────────────────────
|
|
149
152
|
|
|
@@ -168,22 +171,15 @@ plugin.injectEzoicHead = async (data) => {
|
|
|
168
171
|
const excluded = await isUserExcluded(uid, settings.excludedGroups);
|
|
169
172
|
|
|
170
173
|
if (excluded) {
|
|
171
|
-
|
|
172
|
-
// Minimal stub for excluded users — prevents ReferenceError if other
|
|
173
|
-
// scripts reference _ezaq or ezstandalone
|
|
174
|
-
const stub = '<script>'
|
|
175
|
-
+ 'window.ezstandalone=window.ezstandalone||{};'
|
|
176
|
-
+ 'window.ezstandalone.cmd=window.ezstandalone.cmd||[];'
|
|
177
|
-
+ '</script>';
|
|
178
|
-
data.templateData.customHTML =
|
|
179
|
-
stub + '\n' +
|
|
180
|
-
serializeInlineConfig(cfg) +
|
|
181
|
-
(data.templateData.customHTML || '');
|
|
174
|
+
// v50: did nothing for excluded users. Keep it simple.
|
|
182
175
|
} else {
|
|
183
176
|
const cfg = buildClientConfig(settings, false);
|
|
177
|
+
// v50 order: EZOIC_SCRIPTS first, then existing customHTML.
|
|
178
|
+
// Preconnects added after scripts (link tags don't block parsing).
|
|
179
|
+
// Inline config after everything (optimization: avoids API fetch).
|
|
184
180
|
data.templateData.customHTML =
|
|
181
|
+
EZOIC_SCRIPTS +
|
|
185
182
|
HEAD_PRECONNECTS + '\n' +
|
|
186
|
-
EZOIC_SCRIPTS + '\n' +
|
|
187
183
|
serializeInlineConfig(cfg) +
|
|
188
184
|
(data.templateData.customHTML || '');
|
|
189
185
|
}
|