Frame
Media
Another page, shown inside this one: an iframe. on message(m) hears what that page posts to this one (m.data), and nothing any other page posts. Without title: it draws an A17 warning: a frame is announced by its title.
Frame(src: …, title: …, sandbox: …)
Example
Frame(src: "https://www.youtube-nocookie.com/embed/dQw4w9WgXcQ", title: "The launch talk", allow: "fullscreen")
state heard = ""
Frame(src: "/preview/", title: "Preview", sandbox: "allow-scripts") {
on message(m) { heard = m.data }
}
Renders with the class wf-frame, stable across releases, so a stylesheet may target it.
| Prop | Type | Meaning |
|---|---|---|
| src: | String |
The address of the page it shows |
| title: | String |
What it shows, in a few words: its accessible name |
| sandbox: | String |
What the framed page may do: |
| allow: | String |
The features it may use: |
| loading: | .lazy .eager |
Unset, at once |
Attribute families: global, aria, data. Plus the universal props on every element: animate:, exit:, speed:, class:, ref:.