MatFrame

The iframe that fits its content, talks to the page and never fails silently. One tag, <mat-frame>, zero dependencies.

v0.1 · ~4 KB gzip
<mat-frame auto-height sandbox="strict">idle

Auto-height

— px

Add rows inside the frame: no scrollbars, no fixed height.

Promise-based RPC bridge

Message log

    Never fails silently

    A blocked iframe is just a blank box. MatFrame waits for the content to say hello (handshake) and, if it never does, shows a message with “Retry” and “Open in new tab”.

    handshake timeout="2500"idle

    Loads only when needed

    With lazy the content starts when the frame scrolls into view, with an animated skeleton instead of a blank box. The state is readable from CSS: mat-frame[state=ready].

    lazy auto-heightidle

    iframe vs MatFrame

    Feature<iframe><mat-frame>

    How to use it

    In production, set origin="https://child-site.com" on the parent and parentOrigin in the child: messages from other origins are ignored.