Refactor(Render): Allow to read and write clipboard in iframe

This commit is contained in:
2024-05-12 04:09:06 +08:00
parent d0ddb276c0
commit 4f55364f65

View File

@@ -204,6 +204,7 @@ const Render = ({ iframeKey, compiledCode, mobileMode = false }: RenderProps) =>
src={iframeUrl}
onLoad={() => setIsLoaded(true)}
sandbox="allow-downloads allow-forms allow-modals allow-scripts"
allow={'clipboard-read; clipboard-write'}
/>
</div>
<div className={`device-footer${isRotate ? ' rotate' : ''}`} />
@@ -246,6 +247,7 @@ const Render = ({ iframeKey, compiledCode, mobileMode = false }: RenderProps) =>
src={iframeUrl}
onLoad={() => setIsLoaded(true)}
sandbox="allow-downloads allow-forms allow-modals allow-scripts"
allow={'clipboard-read; clipboard-write'}
/>
)
}