Return null from contentDocument and getSVGDocument() on cross-origin access
- Category
- DOM
- Type
- New or changed feature
- Status
- In development (Chrome In development)
- Intent stage
- None
Summary
Change the contentDocument attribute and the getSVGDocument() method of HTMLEmbedElement, HTMLIframeElement, and HTMLObjectElement to return null on cross-origin access, rather than throwing an exception.
Standards & signals
- Specification: https://html.spec.whatwg.org/multipage/iframe-embed-object.html#dom-iframe-contentdocument
- Firefox: Shipped/Shipping
- Safari: No signal
- Web developers: No signals
- Tracking bug: https://crbug.com/582245
Ecosystem
- Web Platform Tests: https://wpt.fyi/results/?q=return-null-from-contentdocument-and-getsvgdocument-on-cross-origin-access
- Chrome Platform Showcase: https://chrome-platform-showcase.paulkinlan-ea.deno.net/features
- GenDN reference: https://gendn.paulkinlan-ea.deno.net/features
- chrome.dev demos search: https://www.google.com/search?q=site%3Achrome.dev+Return%20null%20from%20contentDocument%20and%20getSVGDocument()%20on%20cross-origin%20access
- MDN Web Docs: https://developer.mozilla.org/en-US/search?q=Return%20null%20from%20contentDocument%20and%20getSVGDocument()%20on%20cross-origin%20access
- Baseline status: https://webstatus.dev/?q=Return%20null%20from%20contentDocument%20and%20getSVGDocument()%20on%20cross-origin%20access
Docs: https://html.spec.whatwg.org/multipage/iframe-embed-object.html#dom-iframe-contentdocument https://html.spec.whatwg.org/multipage/embedded-content-other.html#dom-media-getsvgdocument https://html.spec.whatwg.org/multipage/browsers.html#concept-bcc-content-document