Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/embed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -750,6 +750,17 @@ export abstract class Embed {
iframeContent.setAttribute("src", embedUrl);
iframeContent.setAttribute("scrolling", "no");
iframeContent.setAttribute("allowfullscreen", "true");

// Sandbox flags and the permissions-policy container are snapshotted when the frame is
// inserted, so these must be set before appendChild to affect the document that loads.
if (this.config.iframeAllow) {
iframeContent.setAttribute("allow", this.config.iframeAllow);
}

if (this.config.iframeSandbox) {
iframeContent.setAttribute("sandbox", this.config.iframeSandbox);
}

const node = this.element;
while (node.firstChild) {
node.removeChild(node.firstChild);
Expand Down