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

Not supported in Firefox 97.0 / Safari / Mobile Safari #21

Open
joshuapowers opened this issue Feb 23, 2022 · 1 comment
Open

Not supported in Firefox 97.0 / Safari / Mobile Safari #21

joshuapowers opened this issue Feb 23, 2022 · 1 comment

Comments

@joshuapowers
Copy link

joshuapowers commented Feb 23, 2022

Simple to test

FireFox

navigator.permissions.query({
        name: 'clipboard-read'
});

Uncaught (in promise) TypeError: 'clipboard-read' (value of 'name' member of PermissionDescriptor) is not a valid value for enumeration PermissionName.

Safari

TypeError: undefined is not an object (evaluating 'navigator.permissions.query')

The library at least handles Safari due to checking for the permissions object, but FireFox throws an exception.

MDN (see the table on https://developer.mozilla.org/en-US/docs/Web/API/Permissions_API) and CanIUse (https://caniuse.com/permissions-api) both indicate fairly poor support for this experimental API; in fact, it is basically supported only in Chromium based browsers.

I'm not sure what the best solution is here, but some kind of fallback for non-chrome browsers would be great. If that is too much, then just indicating what browsers are supported and tested in the readme would work too.

Thank you :)

@bence-toth
Copy link
Owner

Hi @joshuapowers, thank you for reaching out.

I'm wondering if we could do something slightly smarter here. I can see that the core features (readText and writeText) have pretty decent browser support, so the issue is actually with the Permissions API. I'm thinking that it should be possible to not go through the Permissions API and handle permission checks in another way.

Would you care about taking initiative on this and opening a PR? 🙌

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

No branches or pull requests

2 participants