Update Trusted Type loading
Some checks failed
ci/woodpecker/push/deploy unknown status
ci/woodpecker/push/ci Pipeline failed

This commit is contained in:
2026-03-12 19:54:15 -03:00
parent 5eb34a0c59
commit dac44e1b12

View File

@@ -12,6 +12,8 @@
var hasLoadedThirdParty = false; var hasLoadedThirdParty = false;
// Trusted Types support (for CSP `require-trusted-types-for 'script'`) // Trusted Types support (for CSP `require-trusted-types-for 'script'`)
// Clarity's tag script looks up window.trustedTypePolicies[policyName] to load its inner script;
// we must expose the policy there for Safari (and other browsers) to avoid TT violations.
var ttPolicy = null; var ttPolicy = null;
try { try {
if ( if (
@@ -23,6 +25,14 @@
return url; return url;
}, },
}); });
if (ttPolicy && !window.trustedTypePolicies) {
window.trustedTypePolicies = {};
}
if (ttPolicy) {
window.trustedTypePolicies['mifi-ventures-policy'] = ttPolicy;
}
} }
} catch (_) { } catch (_) {
ttPolicy = null; ttPolicy = null;