0
Fork 0
mirror of https://github.com/penpot/penpot-plugins.git synced 2025-01-06 14:50:21 -05:00

feat: iframe sandbox permission

This commit is contained in:
Juanfran 2024-03-04 10:27:24 +01:00
parent 4e3c25e3ed
commit 9d2eafc1be

View file

@ -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) {