From 44fce1450374f5ddfe68cb22258105b808b743c9 Mon Sep 17 00:00:00 2001 From: Christian Preston Date: Wed, 3 May 2023 10:44:22 -0400 Subject: [PATCH] feat: allow iframe permissions (#215) --- packages/devtools/client/components/IframeView.vue | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/devtools/client/components/IframeView.vue b/packages/devtools/client/components/IframeView.vue index 03d9aa26e..5f9d3d15a 100644 --- a/packages/devtools/client/components/IframeView.vue +++ b/packages/devtools/client/components/IframeView.vue @@ -19,6 +19,7 @@ const box = reactive(useElementBounding(anchor)) onMounted(() => { const view = props.tab.view as ModuleIframeView const isPersistent = view.persistent !== false + const allowedPermissions = ['clipboard-write', 'clipboard-read'] if (iframeCacheMap.get(key.value) && isPersistent) { iframeEl.value = iframeCacheMap.get(key.value)! @@ -26,6 +27,8 @@ onMounted(() => { } else { iframeEl.value = document.createElement('iframe') + iframeEl.value.setAttribute('allow', allowedPermissions.join('; ')) + if (isPersistent) iframeCacheMap.set(key.value, iframeEl.value) iframeEl.value.src = view.src