Update Trusted Type loading
This commit is contained in:
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user