Working with the Javascript buffer after the section was copied from the website

When I copy the test section from this site

my clipboard adds extra text added to the end, saying "More ...", then the URL of the page I read (plus a unique line at the end)

How did they do it?

+4
source share
2 answers

I did some backward development, and it looks like the script is responsible for manipulating the clipboard:

http://tcr.tynt.com/ti.js (use http://jsbeautifier.org/ for see uncompressed code)

Watch the opening movie on this website:

http://www.tynt.com/

Technically, I don’t know how to do this, it looks like they don’t use Flash, but they use the getSelection () function and the copy, contextmenu events .

+1
source

When your selected text on their page (before Copying occurs), a text with zero height is created on the page ( position: absolute; top: -1000px ), containing additional text ("Details: ....."), and this text is then added to the selection.

Therefore, when you copy selected text, you also copy text hidden from the page.

+2
source

Source: https://habr.com/ru/post/1390433/


All Articles