From 0ead91ce4f6e3e5627eae4030c3b260a303556a1 Mon Sep 17 00:00:00 2001 From: FatttSnake Date: Sun, 12 May 2024 04:05:06 +0800 Subject: [PATCH] Refactor(Render): Allow to read and write clipboard in iframe --- src/components/Playground/Output/Preview/Render.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/Playground/Output/Preview/Render.tsx b/src/components/Playground/Output/Preview/Render.tsx index 3c8651a..e8f7d65 100644 --- a/src/components/Playground/Output/Preview/Render.tsx +++ b/src/components/Playground/Output/Preview/Render.tsx @@ -203,7 +203,8 @@ const Render = ({ iframeKey, compiledCode, mobileMode = false }: RenderProps) => ref={iframeRef} src={iframeUrl} onLoad={() => setIsLoaded(true)} - sandbox="allow-downloads allow-forms allow-modals allow-scripts clipboard-read clipboard-write" + sandbox="allow-downloads allow-forms allow-modals allow-scripts" + allow={'clipboard-read; clipboard-write'} />
@@ -245,7 +246,8 @@ const Render = ({ iframeKey, compiledCode, mobileMode = false }: RenderProps) => ref={iframeRef} src={iframeUrl} onLoad={() => setIsLoaded(true)} - sandbox="allow-downloads allow-forms allow-modals allow-scripts clipboard-read clipboard-write" + sandbox={'allow-downloads allow-forms allow-modals allow-scripts'} + allow={'clipboard-read; clipboard-write'} /> ) } -- 2.49.1