Live data from Hacker News

How to control what is copy-pasted to and from the clipboard in the browser

taye.me

1–10 of 40 posts

Re: How to control what is copy-pasted to and from the clipboard in the browser

#4
Why restrict what a visitor can copy from your website? By reducing the site's utility they are less likely to revisit.

taye, I apologize if this isn't a constructive comment but this feature has annoyed me from time to time. Forbes.com just implemented it.

Re: How to control what is copy-pasted to and from the clipboard in the browser

#5
I absolutely hated it when websites did this. If I wanted to copy the text or image, I was going to - whether it be by going to the page source or manipulating it with Firebug. As for those ads websites sometimes through in with whatever text that's being copied, I always delete it after pasting it into my text editor. I've never seen anyone else share those copy-and-pasted ads.

As for trying it on the linked site, I have NoScript installed. Good luck trying to prevent me from copy-and-pasting now.

Re: How to control what is copy-pasted to and from the clipboard in the browser

#6

More important, how do I keep a site from changing what I copy / paste, because this is the crappiest UI change a site can make. I am rather sick of copying a phrase and getting a huge site advertisement and url attached.

I've never actually noticed any site doing that to me as I usually browse with NoScript.

I wrote that post with the intention of using the solution in apps to copy/paste app data in plain text - eg. selecting multiple objects in a drawing app and copying them as a JSON string.

I guess NoScript/Ghostery/AdBlock Plus could be considered solutions to your problem.

Re: How to control what is copy-pasted to and from the clipboard in the browser

#7
post #3

what about mobile clients?

I'm really not sure and I've been too occupied to try things out.

Detecting a long hold and then selecting the text before the usual mobile context menu pops up could be good enough. I only devised this solution for a desktop app.

Re: How to control what is copy-pasted to and from the clipboard in the browser

#8
post #4

Why restrict what a visitor can copy from your website? By reducing the site's utility they are less likely to revisit. taye, I apologize if this isn't a constructive comment but this feature has annoyed me from time to time. Forbes.com just implemented it.

No apology necessary.

As I mentioned in another comment, I use NoScript to disable javascript so I wouldn't even notice that kind of thing. I agree that that is unnecessary and sort of abusive to users. I only intended on using this within web apps like a document editor etc.

Post reply on HN