Loading
Render <iframe> embeds in Vue
What does this MR do and why?
Use Vue to render our <iframe> embeds. This provides the base for Click-to-activate functionality for `<iframe>`s (!254949 - merged), which significantly extends the logic and really wanted Vue.
- We apply a
min-widthin preparation for !254949 (merged), and extract common sizing logic out from the regular render and content editor so dimensions live in one place.- This
min-widthyields to containers narrower than it so it doesn't overflow horizontally; to allow this, embeds now render on their own line rather than inline with text. (There is not really a good reason to permit embeds inline in a paragraph.) max-heightis nowmin(80vh, <height>)when the user sets both width and height; this stops themin-widthfrom making small embeds taller throughaspect-ratio.- In the rich-text editor, resizing an embed starts from its rendered size and stops at the
min-width. px-suffixed dimensions (e.g.{width=560px height=315px}) now keep their aspect ratio; previously they fell back to 150px tall.
- This
- You can now copy/quote the embeds. They'd just vanish before this.
- Please note: the embeds paste into the rich-text editor as an image (which looks broken), and require being saved (or some other roundtrip through the backend) before being rendered as an
<iframe>. This is intentional, and is not new as of this MR: read the second bullet point of !254948 (merged) for details.
- Please note: the embeds paste into the rich-text editor as an image (which looks broken), and require being saved (or some other roundtrip through the backend) before being rendered as an
The feature is behind a wip FF, disabled everywhere; no current users.
MR stack
MR 9/12 of Rework <iframe> embed configuration (#599713):
- Add `<iframe>` provider model and parser (!254943 - merged)
- Add `<iframe>` provider loader and base config (!254944 - merged)
- Convert `<iframe>` allowlist setting to provide... (!254945 - merged)
- Move to `<iframe>` providers (!254946 - merged)
- Remove dead `<iframe>` transform code (!254947 - merged)
- Allow additional CSP hosts in `<iframe>` embeds (!257463 - merged)
- Reject sneaky dot segments in `<iframe>` URLs (!258894 - merged)
- Frontend `<iframe>` hardening (!254948 - merged)
- Render `<iframe>` embeds in Vue (!259513 - merged)
⬅️ you are here - Click-to-activate functionality for `<iframe>`s (!254949 - merged)
- Admin UI for `<iframe>` providers (!254950 - merged)
- Draft: Mark `<iframe>` config, loader and rende... (!255246)
Part of <iframe> embeds in Markdown content (#282443).
Screenshots or screen recordings
{width=1}| What | Before | After |
|---|---|---|
| Rendered | ![]() |
![]() |
| Rich-text editor | ![]() |
![]() |
| Copy-pasting from render into RTE |
How to set up and validate locally
- Check out
master. - Enable the
allow_iframes_in_markdownFF. - Go to Admin → Settings → General → Embedded content.
- Check "Enable embedded content", enter
youtubeinto the "Allowed domains" list, and click "Save changes":
(This interface is odd but will be fixed as of Admin UI for `<iframe>` providers (!254950 - merged). I've also addedfigmaabove for my testing, but it isn't necessary for this scenario.) - For best chances of first-try success, consider restarting your GDK/Caproni edit mode. The FF/setting change may be cached.
- Navigate to a work item, enter the above Markdown in a plain-text area (can be the work item description, or a new comment), and save. You should see the relevant "Before" side.
- Edit the field and enter the rich-text editor. You should see the relevant "Before" side there, too.
- Try copy-pasting the embed from the rendered view into the rich-text editor. (I removed the
{width=1}and put some text on either side to make it easier to copy😹 ) You should see it vanish, like the relevant "Before" side. - Check out this branch.
- Re-check steps 6–8; you should see the relevant "After" sides. (Please note the MR description about why it appears as a broken image on first paste. The plain-text editor Just Works™, though.)
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Edited by Asherah Connor




