Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

navigator.share throws NotAllowedError: Failed to execute 'share' on 'Navigator': Permission denied #2199

Open
ZimnitskiYury opened this issue Mar 5, 2024 · 4 comments

Comments

@ZimnitskiYury
Copy link

Issue:

An error is thrown when attempting to use the navigator.share method within the Microsoft Teams Tab application:
Error: NotAllowedError: Failed to execute ‘share’ on ‘Navigator’: Permission denied

This error prevents the possibility of sharing files using the built-in Windows share functionality.

Question:

Is there a way to request permissions from the user or to add this permission to the app container to enable file sharing?

@ZimnitskiYury ZimnitskiYury changed the title navigator.share throws Error: NotAllowedError: Failed to execute 'share' on 'Navigator': Permission denied navigator.share throws NotAllowedError: Failed to execute 'share' on 'Navigator': Permission denied Mar 5, 2024
@Dinesh-MSFT
Copy link

Hi @ZimnitskiYury - Thanks for raising query.
We will look into this and let you know the update.

@ChetanSharma-msft
Copy link

Hello @ZimnitskiYury - Could you please share the code base and repro steps, so that we can try it from our end?
Also, please the reference doc you are following.

@ZimnitskiYury
Copy link
Author

ZimnitskiYury commented Mar 6, 2024

@ChetanSharma-msft simpliest snippet:

if (microsoftTeams.app.isInitialized()) {
        const isShareSupported = 'share' in navigator && 'canShare' in navigator;
        if (isShareSupported) {
            navigator.share({text: 'test'});
        }
    }

expected result

image

from mdn: https://developer.mozilla.org/en-US/docs/Web/API/Navigator/share#notallowederror

A web-share Permissions Policy has been used to block the use of this feature, the window does not have transient activation, or a file share is being blocked due to security considerations.

@chrisyanasak
Copy link

Hi @ZimnitskiYury. This feature is actually not available in Teams JS. We have added a feature request for it to our backlog that we will review as part of our regular planning cycles, but I'm not able to provide any commitments or ETA at this time unfortunately. If there is any additional information on your use case or the value from your perspective that you would like to share I am happy to add it to the ticket for when we review it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants