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

Merged
FatttSnake merged 1 commits from FatttSnake into dev 2024-05-12 04:06:49 +08:00
Showing only changes of commit 0ead91ce4f - Show all commits

View File

@@ -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'}
/>
</div>
<div className={`device-footer${isRotate ? ' rotate' : ''}`} />
@@ -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'}
/>
)
}