Block websites from reading or modifying Clipboard contents in Firefox

Advertisement

Depending on how a website is configured, it may be able to read or modify Clipboard events that happen on it. Say, you highlight text on the site to copy it to the clipboard of your operating system to paste it into another application.

A script could record what you are copying, or, to take it to another extreme, modify the contents. Some services may for instance add copyright information to the copied text automatically.

A website could also use these events to block you from copying any contents, again by manipulating the event so that nothing is returned.

Other possibilities include preventing paste operations on the site, so that you cannot paste data into form fields but have to type it instead.

Besides being annoying, as you may get a different result than expected, it does have privacy implications as well as sites can log what users paste -- into text areas only I assume -- as well.

dom.event.clipboardevents.enabled

dom events clipboardevents enabled

Firefox has a preference for that, to stop that behavior in its tracks. There may be a downside however to it which needs to be mentioned.

If you are working with rich text editors on the Internet, some may require that those events remain enabled for functionality. A basic example is an editor that processes the text that you are pasting in it to remove all formatting information from it.

To block sites from reading or modifying Clipboard contents in Firefox, do the following:

  1. Type about:config into Firefox's address bar and hit the enter key on the keyboard.
  2. Confirm you will be careful if a warning message pops up.
  3. Use the search up to to find the dom.event.clipboardevents.enabled preference.
  4. The default value of the preference is true, which means that sites can intercept Clipboard events.
  5. Double-click the preference to change its value to false.
  6. Once set, it will block sites from intercepting these events.

Tip: I suggest you monitor your online activities to see if any online editor or site behaves in a different way after you have disabled the feature.

There is unfortunately no option to enable it for individual websites.

Anyway, I highly suggest you set the value of the preference to false to block websites from manipulating Clipboard events in the web browser.

Please share this article

facebooktwittergoogle_plusredditlinkedinmail

Advertisement

Filed under:

Responses to Block websites from reading or modifying Clipboard contents in Firefox

  1. January 8, 2014 at 2:54 pm #

    Excellent advice. Thank you.

  2. Virtualguy January 8, 2014 at 2:59 pm #

    Finally!!! There has always been a setting in IE's internet options, going back as far as I can remember, to disable clipboard access, and I have always made it a point to do so in every computer I service. But, I've never known the way to disable clipboard access in Firefox, until now. Thanks!
    Now, I need to find out how to do this with Chrome.

    • InterestedBystander January 8, 2014 at 6:25 pm #

      Does the Chrome version of AdBlock Plus have an option to block clipboard manipulations? Seems to me I read something about that.

      Very important, obviously, if one uses long-and-strong passwords and copy-pastes them from a file or utility on the PC.

      • Boris January 9, 2014 at 12:28 am #

        I know that makers of Adblockplus have separate extension to do exactly that in Firefox. Chances are that they have something like that for Chrome.

  3. g2free January 8, 2014 at 3:52 pm #

    Tor browser has that set to true maybe they are not aware of it should you tell them?

  4. Kulm January 8, 2014 at 5:38 pm #

    Thanks for the info.
    There's an add-on too.

    Disable clipboard manipulations 1.0.1

    "Web pages will no longer be able to listen to copy, paste and cut events to learn what you are copying or pasting, they won't even know that you do it at all. And they won't be able to interfere to push unwanted content to your clipboard when you copy text."

  5. Mark M January 8, 2014 at 7:40 pm #

    The first site I tried with the setting was my GMail calendar; trying to change the date on an appointment crashes the site. Oh well.

  6. Ron January 8, 2014 at 10:03 pm #

    Thanks for the tip. Never realized that the clipboard could be accessed through Mozilla browsers.

  7. Maou January 9, 2014 at 12:40 pm #

    Thanks Martin, I was unaware about this security issue.

    Sometimes I need to copy passwords from my security vault to paste somewhere else, so that´s a big deal to me.

  8. Dwight Stegall January 10, 2014 at 7:07 am #

    Another potential problem might be sites like TinyURL that give you a Copy To Clipboard llnk when you have the following set to true.

    signed.applets.codebase_principal_support

  9. Ken Saunders January 14, 2014 at 7:16 am #

    Well after setting it to false, some forms aren't automatically filled and that the only change that I can attribute that behavior to so I set it back to true.
    We'll see.

Leave a Reply