Skip to content

Commit

Permalink
feat: allow iframe permissions (#215)
Browse files Browse the repository at this point in the history
  • Loading branch information
cpreston321 committed May 3, 2023
1 parent e64dbcd commit 44fce14
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/devtools/client/components/IframeView.vue
Expand Up @@ -19,13 +19,16 @@ 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)!
iframeEl.value.style.visibility = 'visible'
}
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
Expand Down

0 comments on commit 44fce14

Please sign in to comment.