Advanced Iframes

Three kinds of iframes that need more than a plain frame switch.

Sandboxed iframe (acts like cross-origin)

The sandbox attribute gives this frame its own origin, so the page can't read its document. It talks to the page with postMessage.

Checking access to the sandboxed frame...

No message yet

srcdoc iframe

This frame has no URL: its HTML is in the srcdoc attribute.

Iframe inside shadow DOM

Find the shadow host first, then the iframe in its shadow root.