Skip to content

Commit

Permalink
Update src/renderers/dom.js
Browse files Browse the repository at this point in the history
Co-authored-by: Ravi Shekhar <[email protected]>
  • Loading branch information
magaldima and ravishekhar authored Sep 19, 2024
1 parent 865ae16 commit 84939fb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/renderers/dom.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,11 @@ function addProps(el: HTMLElement | Element, node) {
// If the element is an iframe and it has no srcdoc or src, set the srcdoc to an empty string.
// Content specified via srcdoc is treated as being from the same origin as the parent document.
// In some browsers (like Safari 17+), empty iframes without src or srcdoc may be treated as "anonymous," potentially blocking certain content.
if (el.tagName.toLowerCase() === ELEMENT_TAG.IFRAME && (!props.srcdoc && !props.src)) {
if (
el.tagName.toLowerCase() === ELEMENT_TAG.IFRAME &&
!props.srcdoc &&
!props.src
) {
el.setAttribute('srcdoc', '');
}
}
Expand Down

0 comments on commit 84939fb

Please sign in to comment.