Hacker News new | past | comments | ask | show | jobs | submit login

Why are websites allowed to know that you've selected plain text? (genuinely clueless on web stuff)



I think there are a bunch of decent uses for that, like rich text editors (eg select text, hit ctrl-b, and the text is bolded).

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.


But why does a rich text editor need to talk to a website?


What if the rich text editor and the website are the same thing? What if the rich text editor is part of a larger tool that is the website?


Well, I'm not sure what you're waving at. If the website is nothing more than a RTE, then it's better (and safer) to do it in the browser. If the RTE is just part of the website, then that's a part that's better done in the browser.

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.


Why are websites allowed to know that I hover an element?

Javascript knows about clicks, doubleclicks, hovers... like almost every interaction the user does. There are use cases but also potential to be exploited somehow.


Because websites are apps now. The browser is your operating system.


Click events, hover, etc have always existed (since js exists I'm pretty sure).


Regardless of intent, today websites are often built as 'apps', making browsers more and more like your OS. JS is how that's usually implemented.


In forums you can select parts of someone's post and quote that part in your reply




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: