Websites that cannot “copy and paste” the selected part as it is, and how does it work?


Websites that cannot “copy and paste” the selected part as it is, and how does it work?

“Copy and paste,” which saves document files and website contents to the clipboard and pastes them elsewhere, is now a common practice today when PCs and smartphones have become widespread. Copy and paste is specified by dragging the range to be copied with a mouse, etc., but if there is a website that can not be copied and pasted as specified, the engineer'sAlex EllisPoints out.

Don't touch my clipboardCaffeinspiration

Alexem dashTo copy and paste the symbol,The Punctuation Guide”And tried to copy and paste the contents.

Em dash | The Punctuation Guide

Then, he noticed that the copyright of the site was added in addition to the content selected by Alex.

Alex, who noticed the incident, checked the HTML on the website and found a JavaScript file named "copyright.js".

Looking at the contents of "copyright.js", 15 lines of code were described except for comments and blank lines, and a function called "addLink" was defined. When observing the flow of the addLink function, an operation was performed in which an element was created by combining the range specified by the user and the copyright, and the original selection was replaced with that element.

The behavior of "copyright.js" can also be determined from the appearance of the website. Select website text …

Click “Copy”.

Then the selection highlighted in yellow disappeared. This means that the elements in the selection have been replaced by other elements.

Alex says, "It's important to clarify the attribution of website content, but these behaviors do not respect user behavior." Also, when copying and pasting symbols like "-", he is interested in whether copyright is effective.

The “copyright.js” used on this website isStack OverflowIt has been pointed out that the code posted to was copied and pasted as it was.

How to add extra info to copied web text-stack overflow-stack overflow

Copy the title and URL of this article

Source link

Do you like this article??

Show More

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button