How To Enable Pasting Text on Websites That Block It (2024)

How To Enable Pasting Text on Websites That Block It (1)

  • Adam Douglas
  • technology

As we browse and use websites for variety of reasons you may have unfortunate experience of trying to copy and pastetext into a form field to discover that the ability has been disabled. Restricting or preventing pasting of text breaksthe natural flow of data entry that leads to frustration for a user and takes away their authority to make this decisionon their own. It is even worse for those that choose to use a password manager to login into a website. No one wants tomanually type in a secure password. For better or worse this is happening, so here are a few ways that one can take yourauthority back by blocking this unwanted behaviour.

Environment

Tested using the following.

  • Mozilla Firefox v123.0 (64-bit)
  • Google Chrome/Chromium v122.0.6261.69 (64-bit)

Problem

Unable to copy and paste when interacting with certain websites (e.g. password field).

Solution - Browser Extension

There are a few options available by installing a web browser extension or add-on. However, this comes with a potentialprivacy risk. Make sure to review the permissions granted for the desired extension or add-on. Which ever solution ischosen, don’t forget to verify it’s working.

Don’t f*** with copy and paste
Prevents the blocking of copying from and pasting into web form input fields for all or specific websites.
Chrome web store | Firefox Browser Add-Ons | Chrome/Chromium Project | Firefox Port
NoScript
Allow JavaScript to run only on the trusted domains of your choice while protecting against cross-site scripting (XSS), cross-zone DNS rebinding / CSRF attacks (router hacking) and clickjacking attempts.
Chrome web store | Firefox Browser Add-Ons | Website

Solution - Bookmarklet

Through the use of JavaScript a bookmarklet provides added features to a web browser and is only ran locally when youclick on it. A bookmarklet is conveniently stored within a web browser’s bookmarks. This method has the risk ofcontaining malicious JavaScript code, therefore it is strongly recommended reviewing and understand the JavaScript codebefore using to ensure it is safe to use.

To install the bookmarklet below simply click on “Allow Copy & Paste” and then drag into your bookmarks. Then wheneveran issue arises that is preventing you from copy and pasting simply click on the saved bookmarklet to fix it.

Allow Copy & Paste

The bookmarklet source code uses event listeners to prevent other listeners of the same event from being called.

javascript: (function () { allowCopyAndPaste = function (e) { e.stopImmediatePropagation(); return true; }; document.addEventListener("copy", allowCopyAndPaste, true); document.addEventListener("paste", allowCopyAndPaste, true); document.addEventListener("onpaste", allowCopyAndPaste, true);})();

Solution - Mozilla Firefox Config

This method is a very effective, but it has a couple caveats. By disabling the clipboard events this will affect allwebsites one may visit until it is re-enabled, and it may break some websites intended functionality. As well thisisn’t exactly convenient having to enable or disable this configuration.

  1. Open the Mozilla Firefox web browser.
  2. In the address bar enter about:config and press the Enter key.

    How To Enable Pasting Text on Websites That Block It (2)

  3. Click on the button “Accept the Risk and Continue”.

    How To Enable Pasting Text on Websites That Block It (3)

  4. In the search input field enter dom.event.clipboardevents.enabled.

    How To Enable Pasting Text on Websites That Block It (4)

  5. Double-click on the value to change from true to false for dom.event.clipboardevents.enabled.

    How To Enable Pasting Text on Websites That Block It (5)

  6. Verify changes.

    Test it’s working by using the provided form.

Solution - Manual JavaScript

The JavaScript source code is manually run by using the console found within the Web Developer Tools. This method willrequire running this code each and every time. The source code functions by using event listeners to prevent otherlisteners of the same event from being called.

  1. Open Mozilla Firefox or Google Chrome/Chromium web browser.
  2. Browse to the defending website that is not allowing you to copy and paste into a form field.
  3. Press the F12 key for Web Developer Tools.
  4. Click on “Console” in the top navigation.
  5. Grant code pasting permission if using Google Chrome/Chromium.

    Type “allow pasting” without double quotes into the console and press the Enter key.

  6. Within the Console paste the following JavaScript code.

    var allowCopyAndPaste = function (e) { e.stopImmediatePropagation(); return true;};document.addEventListener("copy", allowCopyAndPaste, true);document.addEventListener("paste", allowCopyAndPaste, true);document.addEventListener("onpaste", allowCopyAndPaste, true);
  7. Verify changes.

    Test it’s working by using the provided form.

Solution - Disable JavaScript

This method is not convenient, but without a doubt works very effectively. However, with JavaScript disabled this maycause some websites to not function properly.

Google Chrome/Chromium

  1. Open the Google Chrome/Chromium web browser.
  2. Choose one of the following methods.

    • Enter address.

      In the address bar enter, chrome://settings/content/javascript and press the Enter.

    • Follow these steps.

      1. Click on context menu (three vertical dots).
      2. Browse to “Privacy and security” > “site settings” > “JavaScript”.
  3. Disable JavaScript using one of two methods.

    • Click on “Don’t allow sites to use JavaScript”
    • Under “Customized behaviors” click on the “Add” button for allow or deny and enter website address.
  4. Verify changes.

    Test it’s working by using the provided form.

Mozilla Firefox

  1. Open the Mozilla Firefox web browser.
  2. In the address bar enter about:config and press the Enter key.

    How To Enable Pasting Text on Websites That Block It (6)

  3. Click on the button “Accept the Risk and Continue”.

    How To Enable Pasting Text on Websites That Block It (7)

  4. In the search input field enter javascript.enable.
  5. Double-click on the value to change from true to false for javascript.enable.
  6. Verify changes.

    Test it’s working by using the provided form.

Verify Solutions

This form input is for testing purposes that has copy and paste disabled in order to test if the solution chosen works.A successful solution will allow text to be pasted into the form field below otherwise the paste will fail.

Support Adamsdesk

Direct support from our audience allows for us to achieve our goal of sustainability. Cast Your Vote of Support.

Donate Affiliates

References

Comments

Reply via Email

How To Enable Pasting Text on Websites That Block It (2024)
Top Articles
Latest Posts
Recommended Articles
Article information

Author: Patricia Veum II

Last Updated:

Views: 6167

Rating: 4.3 / 5 (64 voted)

Reviews: 87% of readers found this page helpful

Author information

Name: Patricia Veum II

Birthday: 1994-12-16

Address: 2064 Little Summit, Goldieton, MS 97651-0862

Phone: +6873952696715

Job: Principal Officer

Hobby: Rafting, Cabaret, Candle making, Jigsaw puzzles, Inline skating, Magic, Graffiti

Introduction: My name is Patricia Veum II, I am a vast, combative, smiling, famous, inexpensive, zealous, sparkling person who loves writing and wants to share my knowledge and understanding with you.