also copy to clipboard for middle click
dustymabe opened this issue · 5 comments
Thank you for writing this extension. I used to use the default button shipped with FF but it was removed and have come here to find refuge.
The one missing feature that I can find is that the old button used to also copy the text into the clipboard that I could then "middle click" my mouse to paste. This copy/middle click workflow is deeply ingrained in my soul. Any chance this plugin could support that too?
Thanks again!
Hi, I'm not familiar with using middle-click to paste. For me, middle-clicking in a web page triggers "auto scrolling" and middle-clicking in the address bar doesn't do anything. Is it a custom function for your mouse?
Ahh. Hmm. I use Linux primarily. Didn't realize it wasn't universal across Operating Systems. From link:
"Most Linux distros are configured the click of a middle mouse button as paste operation. All you have to do is select text, move your mouse to another window and hit the middle mouse button. If you have a scroll wheel, just press on it to past the text."
Okay, if I understand that explanation correctly, you are selecting text and NOT taking any action to copy it to the clipboard. When you middle-click someone, the OS finds the (last active?) selection and copy/pastes its contents to the new destination.
Unfortunately, extensions cannot select the contents of the address bar, but I don't think it's needed in this case. You can select the URL in the address bar without any add-on. Usually you can just click the bar. Or does Linux not copy that particular selection?
Okay, if I understand that explanation correctly, you are selecting text and NOT taking any action to copy it to the clipboard. When you middle-click someone, the OS finds the (last active?) selection and copy/pastes its contents to the new destination.
It's a little more complicated. In Linux there are multiple clipboards (copy/paste buffers). Typically what happens is I can highlight text (for example text on a web page) and then immediately middle click somewhere else to paste that text.
Unfortunately, extensions cannot select the contents of the address bar, but I don't think it's needed in this case. You can select the URL in the address bar without any add-on. Usually you can just click the bar. Or does Linux not copy that particular selection?
Unfortunately for the contents of the address bar in Firefox the text highlighting of the address doesn't work (doesn't copy it to the middle click clipboard). I don't necessarily need the contents of the address bar to be "highlighted" I just need it copied into the "middle click" clipboard.
This may seem like an outlandish request. The only reason I'm here is because this used to work with the old button FF used to provide natively and I'd really like to get back to feature parity with that. Your extension has got me back to a managable working state (thank you!), but I'd really love to figure out how to get it all the way there assuming it's possible and doesn't hurt other users.
The extension does not literally select or copy, it uses a writeText ()
command to put text on the clipboard: https://github.com/jscher2000/copy-frame-or-page-url/blob/master/background.js#L89
I think perhaps what might work for your scenario is to create a new element in the corner of the page, fill it with the URL, then select the URL text. In my imagination, the extension could automatically remove the element after some period of time (say 30 seconds?), or it could have an X button to close it. I don't run Linux so I can't easily test whether that would work.