From 9d2eafc1be214cdc3e5cbfd14bc25d67a711804a Mon Sep 17 00:00:00 2001 From: Juanfran Date: Mon, 4 Mar 2024 10:27:24 +0100 Subject: [PATCH] feat: iframe sandbox permission --- libs/plugins-runtime/src/lib/plugin-modal.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/libs/plugins-runtime/src/lib/plugin-modal.ts b/libs/plugins-runtime/src/lib/plugin-modal.ts index 19bbc23..8037e21 100644 --- a/libs/plugins-runtime/src/lib/plugin-modal.ts +++ b/libs/plugins-runtime/src/lib/plugin-modal.ts @@ -46,6 +46,15 @@ export class PluginModalElement extends HTMLElement { const iframe = document.createElement('iframe'); iframe.src = iframeSrc; + iframe.allow = ''; + iframe.sandbox.add( + 'allow-scripts', + 'allow-forms', + 'allow-modals', + 'allow-popups', + 'allow-popups-to-escape-sandbox', + 'allow-storage-access-by-user-activation' + ); this.addEventListener('message', (e: Event) => { if (!iframe.contentWindow) {