fix(embedded-sdk): grant fullscreen and clipboard-write by default#39943
Merged
Conversation
Contributor
Code Review Agent Run #dda535Actionable Suggestions - 0Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
msyavuz
approved these changes
May 7, 2026
qfcwell
pushed a commit
to qfcwell/superset
that referenced
this pull request
May 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

SUMMARY
The Embedded SDK creates its iframe without an
allowattribute, so modern browsers block the Fullscreen API in cross-origin iframes with the errorDisallowed by permissions policy. As a result the chart Enter Fullscreen action is broken in every embedded dashboard out of the box.The chart code calls
Element.requestFullscreen()(seesuperset-frontend/src/dashboard/components/SliceHeaderControls/index.tsx), which is gated by Permissions Policy independently of the iframe'ssandboxattribute;allow-presentationalone does not satisfy the policy.This change always sets
allow="fullscreen; clipboard-write"on the iframe and merges any host-suppliediframeAllowExtrason top (deduped), so the two SDK-driven features that need Permissions Policy work without the host having to opt in.clipboard-writeis included alongside because the existing "Copy permalink to clipboard" feature has the same class of bug.The
iframeAllowExtrasoption remains backwards compatible: hosts that already pass it just get their entries merged with the new defaults.BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Before
allowattribute.requestFullscreen()from chart code throws "Disallowed by permissions policy"; user sees a toastError enabling fullscreen: Disallowed by permissions policyand the chart never enters fullscreen.Recording.2026-05-07.100024.mp4
After
allow="fullscreen; clipboard-write".Escexits cleanly.iframeAllowExtras: ['camera']getallow="fullscreen; clipboard-write; camera"(defaults preserved, extras appended, no duplicates).after.mp4
TESTING INSTRUCTIONS
Build the SDK:
cd superset-embedded-sdk
npm install
npm run build
In a host app that consumes @superset-ui/embedded-sdk, point at the local build (e.g. npm install ../superset/superset- embedded-sdk) and call embedDashboard({...}) against a Superset dashboard with embedding enabled.
Open the host page in Chrome → DevTools → Elements → locate the injected <iframe>. Confirm it has:
allow="fullscreen; clipboard-write"
Inside the embedded dashboard, hover over any chart → click the ⋯ menu in the top-right corner → click Enter Fullscreen.
Before this PR: red toast Error enabling fullscreen: Disallowed by permissions policy. Chart does not enter fullscreen.
After this PR: chart enters fullscreen; press Esc to exit. No toast.
Pre-fix regression guard: temporarily revert iframe.setAttribute('allow', allowFeatures.join('; ')) in superset-embedded-sdk/src/index.ts, rebuild, reload the host page → the original error toast appears again. Restore the line and the error is gone.
iframeAllowExtras merging: pass iframeAllowExtras: ['camera'] in the host call. The iframe's allow attribute should now read allow="fullscreen; clipboard-write; camera" — defaults preserved, extras appended, no duplicates.
ADDITIONAL INFORMATION