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