Added feature to copy QR to clipboard #304
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
totrue
inabout: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 requiredabout: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.