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

Added feature to copy QR to clipboard #304

Closed
wants to merge 2 commits into from
Closed

Added feature to copy QR to clipboard #304

wants to merge 2 commits into from

Conversation

ketelaar
Copy link

This closes #285 but it has a caveat. This is because I used the Clipboard API in order to copy the QR code to the clipboard, which does not work by default in the current Firefox release. There is another way to implement this using document.execCommand('copy') like this one, but I couldn't get it to work.

When you set dom.events.asyncClipboard.clipboardItem to true in about:config this functions works fine. The issue that is blocking it from being activated by default is being worked on, so this suggests that the required about:config entry might be activated by default some time in the future.

I'm not sure on how to proceed with this, should we maybe add a small description in the options to let users know how to activate it with the current (stable) version of Firefox?

Also, I tested this function on both Windows 11 22H2 and macOS Ventura 13.3 on Firefox 111.0.1 and 112.0b8 (Developer Edition) by pasting the copied image to LibreOffice Writer, which worked fine on both platforms and versions of Firefox.

If something needs to change or is a bit unclear, please let me know, I'll get back to you ASAP.

@rugk
Copy link
Owner

rugk commented Apr 25, 2023

Hi @ketelaar,
first of all, thanks for your first contribution to this project! 🎉 👍 🏅
I hope you'll like this project and enjoy hacking on it… 😃

Note yu can (automatically) let issues close when a PR is merged by adding some "magic" text to your PR body. (Manually linked it now.)
Ah you did that, sorry missed that.

About the clipboard API problem: did you know that web extensions have their own API for clipboard access? I used that in the emoji picker extension for coping the emoji, IIRC that API was only to be used when the address bar search is enabled and the emoji is intended to be copied there.
https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/clipboard may help here.

Otherwise https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Interact_with_the_clipboard may help.

@ketelaar ketelaar closed this by deleting the head repository Oct 27, 2023
@rugk
Copy link
Owner

rugk commented Nov 2, 2023

So I assume you do not want to continue this PR @ketelaar?

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

Successfully merging this pull request may close these issues.

Save QR SVG to copy-paste clipboard
2 participants