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

I wouldn't ever enable clipboard integration -- a malicious site could use it to collect data by using the paste command with execCommand -- they'd grab whatever was on my clipboard, which could include my banking password from my password manager app that I was just getting ready to use.



That's why they only get the ability to programmatically trigger cut and copy, not paste.


Mozilla has it documented. Didn't see anything on the linked site.

https://developer.mozilla.org/en-US/docs/Web/API/Document/ex...


Firefox only makes execCommand("paste") available in trusted contexts aka extensions. You can't execCommand("paste") on a regular web page for fairly obvious security reasons.


I guess there's room for an attack of irritation where a user with something meaningful on their clipboard unwittingly triggers having it overwritten by some nonsense. (Most clipboards effectively being a single mutable item without history or stack/queue behaviour).


Tynt basically did this exact thing as a business model[0].

[0] http://daringfireball.net/2010/05/tynt_copy_paste_jerks


There's easier ways to irritate your users.

Most websites irritate their users, actually.


Speaking of clipboard shenanigans. Could be imagining it, but I seem to remember a while ago there being something certain websites were doing where if you selected and copied text from them, the text that ended up on your clipboard would have a synthesized paragraph about copyright/attribution appended to it.


Yeah, occured to me reading that comment. Lyrics websites used to do it a lot (probably still do). I believe they use invisible text.


Yeah, many tech news sites used to do this. I'm not positive, but I think TechCrunch did at one point, I could be wrong though. Absolutely hate it personally!


iBooks does exactly that; it irritates me to no end. I know why they do it, but still.


Is there programmatic access to the paste command? I only see cut and copy listed.


Paste is disallowed for just this reason.




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

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

Search: