But then: what's to stop websites from detecting you've selected text, unselecting it, and copying the bad text in, and then reselecting it...
There are so many loopholes I can imagine to get around these restrictions :(
But then: what's to stop websites from detecting you've selected text, unselecting it, and copying the bad text in, and then reselecting it...
There are so many loopholes I can imagine to get around these restrictions :(
Disabling JavaScript.
Or conversely, make the visible text “pointer-events: none” and it sits in front of the dangerous text.
There are also some sites that popup a small box above your selection with a share box. Straight to hell with those. Compulsive selectors go mad on those sites. That's you, medium.com.
Perhaps you want a RTE that doesn't depend on JS. I think that's a reasonable thing to want; but if you normally browse with JS switched off, then running into a working RTE is at least going to violate the Principle of Least Surprise.
Javascript knows about clicks, doubleclicks, hovers... like almost every interaction the user does. There are use cases but also potential to be exploited somehow.
My uBlock Origin filters stop them with extreme prejudice.
window.addEventListener('copy', function copyintercept(e) {
console.log(copyintercept.caller, 'copy action initiated');
e.stopImmediatePropagation();
}, true)
document.addEventListener("contextmenu", bringBackDefault, true);
function bringBackDefault(event) { event.returnValue = true;
(typeof event.stopPropagation === 'function') && event.stopPropagation();
(typeof event.cancelBubble === 'function') && event.cancelBubble();
}Couple of things
1. How do you focus a text field without a keyboard? Mouse or touch only? No TAB, no up/down keys for scrolling, no escape, etc.
2. You can disable all non text content in a web page. This was always possible
I can go on and on but what's the point?