3 ms·
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.
by scottmf 9y ago
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);