Live data from Hacker News

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

taye.me

11–20 of 40 posts

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

#12
post #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.

Your use sounds quite nice. Sadly, it seems that the abuse is much more common. Thanks for the suggestions.

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

#13
>>Try right-clicking here to see this working

I right clicked on your "intercepting element," inspected with firebug, and deleted the input node. Then I could copy and paste as I desired. Firefox. 10 seconds?

My point is, we have many better things to spend our time on as developers than trying to control our user's access to the same information we're providing them. This not a reproach to taye, but to the bosses that ask us to build these worthless systems.

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

#14

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 seen sites do it, but I find it fair. Most of the examples I've run into attach something like "Read more at: " which isn't obnoxious. It's also easy to remove from the text that is copied.

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

#15

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 seen sites do it, but I find it fair. Most of the examples I've run into attach something like "Read more at: " which isn't obnoxious. It's also easy to remove from the text that is copied.

In what world is it "fair" for you to alter the behavior of what I expect to happen just because some people find it "easy" to fix the way you broke it?

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

#16

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 seen sites do it, but I find it fair. Most of the examples I've run into attach something like "Read more at: " which isn't obnoxious. It's also easy to remove from the text that is copied.

The majority of times, if not the total, that I encounter this poor design is when I'm in the process of pasting a quote into a tweet while sharing the link with others. Too clever by half.

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

#17
post #15

Earlier quoted context omitted.

I've seen sites do it, but I find it fair. Most of the examples I've run into attach something like "Read more at: " which isn't obnoxious. It's also easy to remove from the text that is copied.

In what world is it "fair" for you to alter the behavior of what I expect to happen just because some people find it "easy" to fix the way you broke it?

Not all copying is fair. Many copyrighted content is copied without the author's permission and used in non-fair-use contexts. Therefore it seems reasonable for the copyright holder to alter the behavior of the copy function and append the URL to the copied text.

But I say that because I'm a reasonable person. If you feel entitled to being able to copy everything as is, then I suppose you won't like it being altered.

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

#18

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.

One of the features I really love in Opera (Presto, 12.16), is the ability to deny sites the ability to detect context menu events. You can do this at a per-site level too. Very useful for sites that mess with copy/paste, or right-click in general.

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

#19
post #15

Earlier quoted context omitted.

In what world is it "fair" for you to alter the behavior of what I expect to happen just because some people find it "easy" to fix the way you broke it?

Not all copying is fair. Many copyrighted content is copied without the author's permission and used in non-fair-use contexts. Therefore it seems reasonable for the copyright holder to alter the behavior of the copy function and append the URL to the copied text. But I say that because I'm a reasonable person. If you feel entitled to being able to copy everything as is, then I suppose you won't like it being altered.

If I want to copy content without authors permission, I won't copy and paste and will just wget the shit out of your web page and carry on. You prevented nothing.

But as a regular user, you just made me angry preventing me to copy and paste or adding obnoxious content (which I'm going to delete anyways).

So you traded a light barrier (if any) to unfair users for a huge annoyance to legitimate ones. Not very smart IMHO.

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

#20

On X11, text is basically copied once it's selected. And of course you're not hooking the menubar Edit > Copy way of copying. There's probably no way to make this consistently work for every kind of copying text. :(

I've seen websites preventing you from selecting any text at all. I usually select the text I'm reading as a sort of mark, so that really annoyed me.
Post reply on HN