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

Unable to use Clipboard Functionality inside iframe #18

Open
cannarelladev opened this issue Jul 8, 2022 · 0 comments
Open

Unable to use Clipboard Functionality inside iframe #18

cannarelladev opened this issue Jul 8, 2022 · 0 comments

Comments

@cannarelladev
Copy link

I didn't find a way to use the navigator.clipboard functionality to create a copy button through a callback like:

const copy = async () => { return await navigator.clipboard.writeText(generateCommand); };

This because of Lens extensions are rendered inside an iframe, and, for a Cross-Origin security policies, this functionality is forbidden. It's a big problem that can be solved adding some "info" to the iframe declaration:

<iframe .... allow="clipboard-write"></iframe>

The console error actually received is:
Uncaught (in promise) DOMException: The Clipboard API has been blocked because of a permissions policy applied to the current document. See https://goo.gl/EuHzyv for more details.

Is it possible to find a solution like the proposed one or something something else suggested by you?
For the extension that i'm developing will be an important and critical feature.

thanks in advance

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

1 participant