Prevent copy text manipulation in Chrome - gHacks Tech News

Prevent copy text manipulation in Chrome

Websites and services can use JavaScript, and other technologies such as Flash if available, to manipulate text that is copied to the clipboard by users.

Some sites use the feature to add a copyright note to the copied text while others may prevent copy operations to the clipboard entirely by erasing the copied contents before they reach the clipboard.

A simple example page -- click here -- demonstrates the process. Select some of the text on the page and copy it to the Clipboard afterwards, for instance by using Ctrl-C.

If you paste the content of the Clipboard afterwards, you will notice that something else entirely has been copied to the Clipboard.

clipboard text manipulation

The page intercepts the copy to Clipboard event, erases what has been copied by the user, and replaces it with text of its own.

The process is called clipboard injection or pastejacking, and it can be very annoying and may even have privacy implications.

Firefox users can disable these clipboard events in the browser, but doing so prevents some operations on sites that make use of these features for legitimate reasons. You may notice that you cannot paste content into forms anymore, that sites may break, or that automatic form filling is not working anymore.

Firefox users have access to an array of browser add-ons that disable Clipboard manipulating as well: RightToClick for example.

Google Chrome users cannot just flip a switch in the web browser to block sites from reading and manipulating copied text, but extensions are available that add the feature to Google Chrome.

Probably the most convenient option for Chrome users is RightToCopy. It prevents sites from manipulating copied text before it is copied to the Clipboard, and does away with some other annoyances such as disabled right-click menus.

Downside is that it requires read and write access of data on the websites you visit in Chrome. While the permission request is understandable, since it needs to work on sites you visit to prevent those sites from being annoying.

Real Copy is an alternative. The extension adds an icon to the Chrome toolbar that you can click on after selecting text to make sure the selected text is copied and not manipulated.

chrome real copy

The extension is not available o the Chrome Store but only on GitHub. This means that you need to load it as an unpacked extension currently.

  1. Download the extension from the GitHub website and extract it to a location of your choosing.
  2. Load chrome://extensions/ in the address bar of the Chrome browser.
  3. Check the developer mode box at the top of the page that opens.
  4. Select load unpacked extension, and pick the Real Copy root folder on the device.

The extension is now installed and ready for use.

Google Chrome may prompt you at times that you have installed a developer extension but that is the only downside here.

An even simpler solution, one that does not work on all sites, is to disable JavaScript completely on the site you are on to prevent it from hijacking the clipboard operation.

Both Chrome extensions enable you to copy text without interference from the site the text is copied on.

Summary
Prevent copy text manipulation in Chrome
Article Name
Prevent copy text manipulation in Chrome
Description
Find out how to prevent websites and services from manipulating text that you want to copy to the Clipboard of the computer when using Google Chrome.
Author
Publisher
Ghacks Technology News
Logo




  • We need your help

    Advertising revenue is falling fast across the Internet, and independently-run sites like Ghacks are hit hardest by it. The advertising model in its current form is coming to an end, and we have to find other ways to continue operating this site.

    We are committed to keeping our content free and independent, which means no paywalls, no sponsored posts, no annoying ad formats (video ads) or subscription fees.

    If you like our content, and would like to help, please consider making a contribution:

    Comments

    1. Dave said on May 24, 2016 at 6:11 pm
      Reply

      Clipboard events shouldn’t exist. Got a scammy ad running at the bottom of a website while you’re doing your finances in another program, with the browser minimised? Don’t copy anything in case the ad grabs it. Stupid feature.

      Of course you can turn this rubbish off in Firefox, and interestingly it’s off in IE by default.

      1. Croatoan said on May 24, 2016 at 9:53 pm
        Reply

        Even better. Without addons. Select and drag text to url bar, then copy text :)

        Someone at this site recommended this trick to me :)

    2. CHEF-KOCH said on May 24, 2016 at 8:26 pm
      Reply
    3. Neil D Great said on July 5, 2017 at 8:29 pm
      Reply

      Kudos, it works, tho the formatting is gone.

    Leave a Reply