Skip to content

Commit

Permalink
Revert "fix(iframe): add empty srcdoc attribute to iframe elem if not…
Browse files Browse the repository at this point in the history
… exist (…"

This reverts commit b21a468.
  • Loading branch information
dtjones404 authored Oct 2, 2024
1 parent 62878f0 commit 6f2e0f7
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions src/renderers/dom.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,17 +118,6 @@ function addProps(el: HTMLElement | Element, node) {
if (el.tagName.toLowerCase() === ELEMENT_TAG.IFRAME && !props.id) {
el.setAttribute(ELEMENT_PROP.ID, `jsx-iframe-${uniqueID()}`);
}

// 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
) {
el.setAttribute("srcdoc", "");
}
}
const ADD_CHILDREN: {
[string]: (HTMLElement | Element, ElementNode, DomNodeRenderer) => void,
Expand Down

0 comments on commit 6f2e0f7

Please sign in to comment.