You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
due to the manipulation of some DOM elements via innerHTML property.
I think the fix is to change the code to something more like:
// let call supply the trusted types name via config.trustedTypesPolicyName to opt-in to trusted types support// at top of moduleconstttpConfig={// normally these methods would santize their input, but we know what we are doing and we trust the// input so our methods are merely identity functionscreateHTML: input=>inputcreateScript: input=>inputcreateScriptURL: input=>input}constttp=(typeoftrustedTypes!=="undefined")&&config.trustedTypesPolicyName ?
// we know what we are doing and do not need to sanitize the inputtrustedTypes.createPolicy(config.trustedTypesPolicyName,ttpConfig)
: ttpConfig;// anywhere innerHTML is being set// el.innerHTML = htmlel.innerHTML=ttp.createHTML(html)// anywhere script src is being set//scriptEl.src = urlscriptEl.src=ttp.createScriptURL(url)// anywhere Function constructor is being used:// f = new Function ("a", "b", code)f=newFunction("a","b",ttp.createScript(code))
This CSP policy
causes the shim to fail during init:
due to the manipulation of some DOM elements via
innerHTML
property.I think the fix is to change the code to something more like:
See https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/require-trusted-types-for
The text was updated successfully, but these errors were encountered: