SOLVED

Unable to use Clipboard API in custom Teams App

Copper Contributor

Hi,

 

Im trying to develop a teams app, and an integral part of the app is to be able to copy a string to the clipboad of the user.

 

The app works fine when viewed in the browser (not as an embedded page within the teams enviroment), but while using it in teams the following error appears: 

Microsoft.JSInterop.JSException: The Clipboard API has been blocked because of a permissions policy applied to the current document. 
See https://permanently-removed.invalid for more details.

So is there any way to update the clipboard permission policy within our organization?

I really can't seem to find any documentation regarding the Clipboard policy for teams / 365.

 

Context:

The app is built with Blazor and TeamsFx sdk.

5 Replies

@OliKIspan - Could you please refer below doc and check if it helps: Clipboard API - Web APIs | MDN (mozilla.org)

Could you please confirm if this helped you in any way? Are you still facing the issue?
@OliKIspan - If above answer is helpful, could you please accept it for more visibility?
best response confirmed by Prasad_Das-MSFT (Microsoft)
Solution

Hi, @ChetanSharma-msft

 

This does unfortunately not work, I'm pretty sure the problem is that teams doesn't allow the Clipboard API within the embedded page container.

 

And i think there currently is no way to get that permission.

 

@OliKIspan -
Technically, this would be supported by the browser Permissions Policy, by adding an option to the allow attribute of the embedded iframe.
https://web.dev/async-clipboard/#permissions-policy-integration
Please also refer similar thread: Clipboard API has been blocked because of a Feature Policy applied to the current document. iframe o...

1 best response

Accepted Solutions
best response confirmed by Prasad_Das-MSFT (Microsoft)
Solution

Hi, @ChetanSharma-msft

 

This does unfortunately not work, I'm pretty sure the problem is that teams doesn't allow the Clipboard API within the embedded page container.

 

And i think there currently is no way to get that permission.

 

View solution in original post