From 2fefd9da01c827160fa5fd9b63a38615ea9969e2 Mon Sep 17 00:00:00 2001 From: Kelian Baert Date: Fri, 27 Mar 2026 18:05:15 +0100 Subject: [PATCH] feat: add "allowModals" option for iframe widget (#5339) --- packages/translation/src/lang/en.json | 4 +++- packages/widgets/src/iframe/component.tsx | 4 ++++ packages/widgets/src/iframe/index.ts | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/translation/src/lang/en.json b/packages/translation/src/lang/en.json index 77d37810f..29fb9b979 100644 --- a/packages/translation/src/lang/en.json +++ b/packages/translation/src/lang/en.json @@ -1625,6 +1625,9 @@ }, "allowGeolocation": { "label": "Allow geolocation" + }, + "allowModals": { + "label": "Allow modals" } }, "error": { @@ -2033,7 +2036,6 @@ "directStream": "Direct Stream" } }, - "recentActivity": { "title": "Recent Activity", "empty": "No recent activity", diff --git a/packages/widgets/src/iframe/component.tsx b/packages/widgets/src/iframe/component.tsx index 67fa73536..74032c5f5 100644 --- a/packages/widgets/src/iframe/component.tsx +++ b/packages/widgets/src/iframe/component.tsx @@ -105,6 +105,10 @@ const getSandboxFlags = ( baseSandbox.push("allow-popups-to-escape-sandbox"); } + if (permissions.allowModals) { + baseSandbox.push("allow-modals"); + } + return baseSandbox; }; diff --git a/packages/widgets/src/iframe/index.ts b/packages/widgets/src/iframe/index.ts index 9e6cc06e1..d4313aebe 100644 --- a/packages/widgets/src/iframe/index.ts +++ b/packages/widgets/src/iframe/index.ts @@ -17,6 +17,7 @@ export const { definition, componentLoader } = createWidgetDefinition("iframe", allowMicrophone: factory.switch(), allowCamera: factory.switch(), allowGeolocation: factory.switch(), + allowModals: factory.switch(), })); }, }).withDynamicImport(() => import("./component"));