Changing attributes of iframe

We have an app that has copy-paste feature. This feature has been working fine until recently when Chrome locked it within security boundaries. The way through is to pass the Iframe this parameter:
allow="clipboard-read; clipboard-write"

I want to know if we can, somehow pass certain attributes to the Iframe.

6 Likes

I doubt Atlassian would add those flags and if they do it’ll be a loooong wait.

Try disabling the clipboard API. eg I use this package in one of my apps and the copy function still works on latest Chrome: use-clipboard-hook - npm

const { ref, copy, isCoppied } = useClipboard({
    copiedDuration: 3000,
    disableClipboardAPI: true,
  })
1 Like

Unfortunately even when using this method I get an error:

index.es.js?4ba8:56 Uncaught (in promise) Error: NotAllowedError: The Clipboard API has been blocked because of a permissions policy applied to the current document. See https://goo.gl/EuHzyv for more details.
    at handleError (index.es.js?4ba8:56:1)
    at eval (index.es.js?4ba8:69:1)

Adding the parameters

{
    copiedDuration: 3000,
    disableClipboardAPI: true,
 }

made it work!

Thank you!

1 Like

Ayy awesome!