-
Notifications
You must be signed in to change notification settings - Fork 24
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
Add useClipboard
hook
#28
Comments
Hey @kripod do you need someone to build that? I could give it a go :) |
@maciekgrzybek I would appreciate if you could take the challenge of implementation! |
@kripod I'll crack on then :) |
@kripod could please explain a little bit more about the 'Details' part? |
When using the Clipboard API, permissions should be requested from the user at first. If the user refuses to give them, call an optionally supplied |
Ok, that makes sense, so I'm guessing I should use this API right? https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/permissions |
Or is it native browser behaviour to ask the user for the permission? |
I'm not sure about it, as it isn't documented in depth. |
Ok thanks, @kripod, I'll investigate it. |
@kripod one more thing, what's the approach for developing hooks in this project? is there something like an example page to test it? or do I need to create something external? |
@maciekgrzybek Unfortunately, there is no example page to test hooks with, but Jest is being used for writing tests. I am considering migration to a monorepo to resolve #77 and prepare structural requirements for #26. |
Hey, I've added PR for this - #85 |
@maciekgrzybek Thank you for your valuable contribution! In the meantime, the project has been migrated to a monorepo with a package called Unfortunately, I will be busy in the next days due to tasks at university, so I may not be able to review your code immediately. I appreciate your efforts, keep up the nice work! |
Hey @kripod I've added it to a new repo :) |
Motivation
When it comes to interacting with the clipboard, multiple options are available. The Clipboard API is not yet widely supported by browsers.
A compatible solution should be available out of the box:
document.execCommand()
if necessaryBasic example
Details
Lack of permissions (e.g. for pasting) should be handled gracefully with opt-in support for error callbacks.
The text was updated successfully, but these errors were encountered: