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
Trusted Types in overlay.js issue with innerHTML inside div from iframe.
Caused by setting HTTP Header Content-Security-Policy require-trusted-types-for 'script'
Actual Behavior
iframeContainerElement.onload=function(){varcontentElement=/** @type {Document} *//** @type {HTMLIFrameElement} */iframeContainerElement.contentDocument.createElement("div");containerElement=iframeContainerElement.contentDocument.createElement("div");// ^^^ we assign a div created inside the iframe to `containerElement`[...]
Which we then later try to set innerHTML = "" to:
functionensureOverlayExists(callback,trustedTypesPolicyName){if(containerElement){containerElement.innerHTML="";// <----// Everything is ready, call the callback right away.callback(containerElement);return;}
Unfortunately setting a 'default' policy in the main frame doesn't work because this containerElement is a different window frame (iframe).
Uh oh!
There was an error while loading. Please reload this page.
Bug report
Trusted Types in overlay.js issue with innerHTML inside div from iframe.
Caused by setting HTTP Header
Content-Security-Policy require-trusted-types-for 'script'
Actual Behavior
Which we then later try to set
innerHTML = ""
to:Unfortunately setting a 'default' policy in the main frame doesn't work because this containerElement is a different window frame (iframe).
Expected Behavior
Should not violate the CSP rule.
Potential Fix
containerElement.innerHTML = overlayTrustedTypesPolicy ? overlayTrustedTypesPolicy.createHTML("") : ""
How Do We Reproduce?
Please paste the results of
npx webpack-cli info
here, and mention other relevant informationThe text was updated successfully, but these errors were encountered: