Skip to content

Commit

Permalink
Merge pull request #38 from krakenjs/revert-36-add-srcdoc-iframe-elem
Browse files Browse the repository at this point in the history
Revert "fix(iframe): add empty srcdoc attribute to iframe elem if not exist"
  • Loading branch information
dtjones404 authored Oct 3, 2024
2 parents 62878f0 + 6f2e0f7 commit 957a36a
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 957a36a

Please sign in to comment.