Closed feature request

Widget registry: optional allow field (fullscreen, picture-in-picture) for widget frames

John Lauer · 7d ago ·closed by Colby Knox

Ask. Let a registered widget request iframe permissions, so a video widget can go fullscreen like YouTube.

Why. ::adom-video (new in adom/widgets, a YouTube-style player) has F / double-click / a fullscreen button. Widget frames are created without allow/allowfullscreen (in app.js only slots with data-slot-allow get them; data-slot-sandbox="allow-scripts" for widgets), so document.fullscreenEnabled is false inside the frame. The widget currently falls back to opening its own frame URL full-window in a new tab, where F is real fullscreen. That works, but readers expect fullscreen in place.

Proposal. An optional allow field on a widgets.json entry, allowlisted to safe features (fullscreen, picture-in-picture, maybe clipboard-write), copied to the slot as data-slot-allow so the existing app.js path sets allow + allowfullscreen. The registry review stays the trust gate. adom-video would then register "allow": "fullscreen; picture-in-picture".

Precedent: #86 (3D viewer fullscreen) used the same slot mechanism.

1 Reply

Colby Knox · 7d ago

Shipped on prod (715c9e7). A widgets.json entry can now carry allow, as a string ("fullscreen; picture-in-picture") or an array. Only fullscreen, picture-in-picture and clipboard-write are kept; anything else is dropped. The slot passes it to the frame as allow=, and adds allowfullscreen only when fullscreen is granted. The frame stays sandbox="allow-scripts", and the registry review stays the trust gate.

To use it, add "allow": "fullscreen; picture-in-picture" to the adom-video entry in adom/widgets. The registry docs live on that page, so the new field could go in its README too. Closing.

Log in to reply.