Recent searches
No recent searches
[Violation] Permissions policy violation: The Clipboard API has been blocked because of a permissions policy applied to the current document
Posted Aug 30, 2024
Hello!
We're experiencing an issue with Clipboard copy from our ZAF application which is located in the left navigation bar, as per manifest.json:
...
"signedUrls": true,
"location": {
"support": {
"nav_bar": {
"url": "...",
"flexible": true
}
}
},
...
Our app is firing an error on attempting to copy any text to the clipboard:
[Violation] Permissions policy violation: The Clipboard API has been blocked because of a permissions policy applied to the current document.
It turns out that any ZAF application is automatically placed by Zendesk inside an <iframe> which is a cross origin iframe. According to our research it should be possible to resolve this by adding following 'allow' attribute to the iframe, but this should be done by Zendesk!
<iframe src="index.html" allow="clipboard-read; clipboard-write"></iframe>
We use standard code to fill-in the clipboard:
navigator.clipboard.writeText("string"))
see doc here:
https://developer.mozilla.org/en-US/docs/Web/API/Clipboard/writeText
Also, please note that we already created a ticket to Zendesk (#12790398), and here is their feedback:
...After reviewing the information that you provided, I wanted to put you in contact with our Developer Support team. They have more in-depth knowledge of our platform tools and will be able to get you the best possible answers and solutions. This team works out of our Developer Support community, which will also give you the opportunity to have other developers to share their insight as well!
Thanks for any help!
Marco
0
0 comments