0

So I was reading an article on hotrod magazine, and I copy pasted a little section to my friend.

But somehow, the website was able to add a footer to my clipboard after I copied the text, so it looked like:

"Times change. It wasn't that long ago that if you owned a set of oxy-acetylene gas bottles for welding and cutting you would be considered to

Read more: http://www.hotrod.com/how-to/additional-how-to/0910rc-mig-and-tig-welding/#ixzz3R5Y4WvrJ

Follow us: @HotRodMagazine on Twitter | HotRodMag on Facebook"

How did they add that to the clipboard?

Nikita240
  • 1,377
  • 2
  • 14
  • 29
  • possible duplicate of [How do I copy to the clipboard in JavaScript?](http://stackoverflow.com/questions/400212/how-do-i-copy-to-the-clipboard-in-javascript) – Sumurai8 Feb 07 '15 at 19:37
  • @Sumurai8 No, that question prompts how to initiate a clipboard operation, not how to modify it. – Nikita240 Feb 07 '15 at 19:39
  • 1
    You listen when the user presses ctrl+c, then you write your own text to the clipboard. It tackles the same problem. – Sumurai8 Feb 07 '15 at 19:41

1 Answers1

1

OK, about how to control the clipboard, I think I searched before, there is no 100% cross browsers solution, the best solution is using Flash...

I don't know maybe there is new solution now.

Back to your question, after investigated, I think that web page uses this library:

http://www.tynt.com/product_copypaste

The javascript is obfuscated, so maybe other guys know exactly how is it implemented?

cn123h
  • 2,302
  • 1
  • 21
  • 16