I would like to change the text that will be pasted without changing the selection's appearance on the screen, similar to what the Linux xsel command can do.
Ideally this would work on all platforms and browsers, but at the very least I want it to work on Chrome running on Linux.
My usecase is that I have a button that selects a block of shell commands from the web page (this is done by some library magic that I have no easy access to) and I want to add a terminating newline "behind the scenes" so that when the user middle-clicks in the console, he gets the text that appears highlighted on the screen plus a newline.
How to do it?
depending on how you want to use it). – GertG Apr 20 '17 at 08:03