News for hackers. Stuff that matters.
Re:Be careful what you copy: Invisibly inserting usernames i... by vbezhenar on Wednesday April 04, 2018 @02:39AM (#16752521)
I don't think that it's too difficult. Just check every tag's text for forbidden characters and replace them with something. I'm not sure about performance.
Re:Be careful what you copy: Invisibly inserting usernames i... by scottmf on Wednesday April 04, 2018 @09:02AM (#16754269)
Besides performance concerns, if you did it on each page load it would miss any content added to the page after the initial load. It would be useless for SPAs.

The best way I can think to implement it would be listening for a copy event and replacing the text in the clipboard.

Something like:

  document.addEventListener('copy', sanitizeClipboardContent);