From 1c910197646666d673564db6c29a02e7ad26cce5 Mon Sep 17 00:00:00 2001 From: Maksim Chervonnyi Date: Wed, 18 Sep 2024 18:48:19 +0200 Subject: [PATCH] allow popups in iframes --- .github/workflows/deploy-catalog.yaml | 1 + catalog/app/components/Preview/loaders/Html/Html.tsx | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy-catalog.yaml b/.github/workflows/deploy-catalog.yaml index fc4f8aed0fe..f98c47573f3 100644 --- a/.github/workflows/deploy-catalog.yaml +++ b/.github/workflows/deploy-catalog.yaml @@ -4,6 +4,7 @@ on: push: branches: - master + - iframe-allow-popups paths: - '.github/workflows/deploy-catalog.yaml' - 'catalog/**' diff --git a/catalog/app/components/Preview/loaders/Html/Html.tsx b/catalog/app/components/Preview/loaders/Html/Html.tsx index b2b0d8f00e1..2e4cc251b44 100644 --- a/catalog/app/components/Preview/loaders/Html/Html.tsx +++ b/catalog/app/components/Preview/loaders/Html/Html.tsx @@ -210,7 +210,7 @@ function IFrameLoaderBrowsable({ handle, children }: IFrameLoaderBrowsableProps) PreviewData.IFrame({ src: `${cfg.s3Proxy}/browse/${sessionId}/${handle.logicalKey}`, modes: [FileType.Html, FileType.Text], - sandbox: 'allow-scripts allow-same-origin', + sandbox: 'allow-scripts allow-popups allow-same-origin', }), }, sessionData, @@ -236,7 +236,9 @@ function IFrameLoaderSigned({ handle, browsable, children }: IFrameLoaderSignedP PreviewData.IFrame({ src, modes: [FileType.Html, FileType.Text], - sandbox: browsable ? 'allow-scripts allow-same-origin' : 'allow-scripts', + sandbox: browsable + ? 'allow-scripts allow-popups allow-same-origin' + : 'allow-scripts', }), ), )