nodebb-plugin-ezoic-infinite 1.8.82 → 1.8.84
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 +4 -1
- package/package.json +1 -1
- package/public/client.js +5 -38
package/library.js
CHANGED
|
@@ -159,10 +159,13 @@ const HEAD_PRECONNECTS = [
|
|
|
159
159
|
// Ezoic's TCF cross-frame channel is ready when sa.min.js calls defineScript.
|
|
160
160
|
// Without it the CMP fails to register consent and defineScript throws.
|
|
161
161
|
const EZOIC_SCRIPTS = [
|
|
162
|
+
// __tcfapiLocator must exist before CMP scripts so the TCF cross-frame channel is ready.
|
|
162
163
|
'<script data-cfasync="false">(function(){if(document.getElementById("__tcfapiLocator"))return;var f=document.createElement("iframe");f.style.display="none";f.id=f.name="__tcfapiLocator";(document.head||document.documentElement).appendChild(f);}())</script>',
|
|
164
|
+
// Initialize ezstandalone cmd queue BEFORE sa.min.js (required by Ezoic).
|
|
165
|
+
'<script data-cfasync="false">window.ezstandalone=window.ezstandalone||{};window.ezstandalone.cmd=window.ezstandalone.cmd||[];</script>',
|
|
163
166
|
'<script data-cfasync="false" src="https://cmp.gatekeeperconsent.com/min.js"></script>',
|
|
164
167
|
'<script data-cfasync="false" src="https://the.gatekeeperconsent.com/cmp.min.js"></script>',
|
|
165
|
-
'<script src="//www.ezojs.com/ezoic/sa.min.js"></script>',
|
|
168
|
+
'<script data-cfasync="false" src="//www.ezojs.com/ezoic/sa.min.js"></script>',
|
|
166
169
|
'<script src="//ezoicanalytics.com/analytics.js"></script>',
|
|
167
170
|
].join('\n');
|
|
168
171
|
|
package/package.json
CHANGED
package/public/client.js
CHANGED
|
@@ -794,41 +794,6 @@
|
|
|
794
794
|
try { window.__nbbAriaObs.observe(document.body, { attributes: true, attributeFilter: ['aria-hidden'] }); } catch (_) {}
|
|
795
795
|
}
|
|
796
796
|
|
|
797
|
-
// ── Console muting ─────────────────────────────────────────────────────────
|
|
798
|
-
|
|
799
|
-
const MUTED_RE = (() => {
|
|
800
|
-
const esc = s => s.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
801
|
-
return new RegExp([
|
|
802
|
-
`with id ${PH_PREFIX}`,
|
|
803
|
-
'adsbygoogle.push() error',
|
|
804
|
-
'already been defined',
|
|
805
|
-
'bad response. Status',
|
|
806
|
-
'slotDestroyed',
|
|
807
|
-
'identity bridging',
|
|
808
|
-
'[EzoicAds JS]: Placeholder',
|
|
809
|
-
'No valid placeholders',
|
|
810
|
-
'cannot call refresh',
|
|
811
|
-
'no placeholders are currently defined',
|
|
812
|
-
'Debugger iframe already',
|
|
813
|
-
'Error in custom getTCData',
|
|
814
|
-
'no interstitial API',
|
|
815
|
-
'JS-Enable should only',
|
|
816
|
-
].map(esc).join('|'));
|
|
817
|
-
})();
|
|
818
|
-
|
|
819
|
-
function muteConsole() {
|
|
820
|
-
if (window.__nbbEzMuted) return;
|
|
821
|
-
window.__nbbEzMuted = true;
|
|
822
|
-
for (const method of ['log', 'info', 'warn', 'error']) {
|
|
823
|
-
const orig = console[method];
|
|
824
|
-
if (typeof orig !== 'function') continue;
|
|
825
|
-
console[method] = function (...args) {
|
|
826
|
-
if (typeof args[0] === 'string' && MUTED_RE.test(args[0])) return;
|
|
827
|
-
return orig.apply(console, args);
|
|
828
|
-
};
|
|
829
|
-
}
|
|
830
|
-
}
|
|
831
|
-
|
|
832
797
|
// ── Network warmup ─────────────────────────────────────────────────────────
|
|
833
798
|
|
|
834
799
|
let _warmed = false;
|
|
@@ -915,14 +880,16 @@
|
|
|
915
880
|
_retries++;
|
|
916
881
|
patchShowAds();
|
|
917
882
|
|
|
918
|
-
//
|
|
883
|
+
// Reload sa.min.js only if Ezoic never initialized at all (no loadingStatus).
|
|
884
|
+
// Do NOT reload when loadingStatus === 'complete' (post-defineScript-failure):
|
|
885
|
+
// that would trigger a second defineScript failed error.
|
|
919
886
|
if (!_scriptReloaded && _retries <= 3) {
|
|
920
887
|
const ez = window.ezstandalone;
|
|
921
|
-
|
|
922
|
-
if (status && status !== 'LOADED' && status !== 'LOADING') {
|
|
888
|
+
if (!ez?.loadingStatus) {
|
|
923
889
|
_scriptReloaded = true;
|
|
924
890
|
try {
|
|
925
891
|
const s = document.createElement('script');
|
|
892
|
+
s.setAttribute('data-cfasync', 'false');
|
|
926
893
|
s.src = '//www.ezojs.com/ezoic/sa.min.js';
|
|
927
894
|
document.head.appendChild(s);
|
|
928
895
|
} catch (_) {}
|