The problem occurs on multiple sites, and in Firefox as well. The issue lies with the dom.event.clipboardevents.enabled setting which, if set to false (for privacy reasons), partially breaks the functionality of the add-on. If this setting is disabled, only the last saved selection is copied to the clipboard. Also, it is only saved if the text is still highlighted when copying saved data to the clipboard, otherwise the clipboard contents remain unchanged. So for it to work with the setting disabled, the text you want copied to the clipboard has to be highlighted, you have to save the selection, then, while the text is still selected, you have to copy the selection to the clipboard. This also means you can’t do multiple selections, so it defeats the whole purpose of the add-on. Ideally, the add-on should work with this setting disabled (assuming you can make it), otherwise, it should provide a warning, either through the addons.mozilla.org page, the add-on info page, and/or a warning the add-on provides if it sees the setting is disabled.
The cause of the delay I mentioned before appears to be that when the setting is enabled, the add-on tried to play catch-up, sequentially (AFAICT) going through the items saved and copied to clipboard while the setting was disabled. It goes essentially like this:
dom.event.clipboardevents.enabled = false
Save A & Copy saved to clipboard
Save B then C & Copy saved to clipboard (keeping C highlighted)
Save D then highlight E & Copy saved to clipboard (without saving E)
Paste E [whatever is highlighted is what gets copied to clipboard…]
Copy F (without saving it) then unhighlight it
Paste E […but only if something is saved, otherwise clipboard contents are untouched]
dom.event.clipboardevents.enabled = true
Save & Copy H
Save & Copy I
Paste B+C (note only C was copied to clipboard originally)
Save & Copy J
Paste D (note D was never copied to clipboard originally)
What’s interesting here (besides the obvious fact that the add-on is going back through all the stuff saved/copied while the setting was disabled) is that, despite the multi-copying (and copying without having text highlighted) being broken, all that stuff was in fact saved properly in the add-on’s “memory,” since it’s being copied to and pasted from the clipboard as it was originally intended. So the setting doesn’t seem to be totally breaking the add-on, more just messing with its behavior. I haven’t done extensive enough testing to see how many items it retains, but basically it seems that if you copy x times to the clipboard with it while the setting is disabled, once you enable it the add-on will also be x items behind in what it copies to the clipboard from that point on. So if you copy 10 times (whether some or all of them are single selections or multiple selections), then enable the Firefox setting, the first time you perform another copy with it, it will copy the first thing you copied with the setting disabled to the clipboard, so by the 11th time you copy something, you’ll finally get to the first item you copied since enabling the setting. The only way I’ve found to reset it to remove this lag is by disabling then re-enabling the add-on (though I’ve had this not work, which I suspect is because it wasn’t disabled for long enough; it seems to need to be disabled for several seconds). After that, as long as the Firefox setting remains enabled, the add-on works as expected.
So in summary:
- To fix the issue, which seems like it might be possible due to the fact all the saved/copied text is retained while the setting is disabled, the add-on needs to be changed so it copies all selected text to the clipboard, not whatever happens to be highlighted at the time the command is given, and it needs to not go back through those items if the setting happens to be enabled at any point.
- If it can’t be fixed, or you choose not to fix it, there needs to be a warning, since this is one of the more commonly adjusted privacy settings, so it’s not unreasonable to assume there will be others that will experience an issue due to it and waste time trying to figure it out.
Hopefully that’s all clear enough to make sense of and provides you with the necessary info to troubleshoot and, hopefully, fix it. It was a pain figuring it out and figuring out all the nuances of it, and I got interrupted halfway through, so hopefully I didn’t forget something.