How to allow pasting password when blocked on Google Chrome

I use the gpass password manager to store my randomly generated unique password for each site. However, many sites such as net banking prevent you from pasting a password when signing up. The site owner or webmaster disables pasting into password input fields. Want to paste your password on such site? Give it a try to don’t f*ck with paste Google Chrome extension.

ADVERTISEMENTS

The pasting problem

From the project page:

It annoys me to no end when a web application prevents me from being able to paste content into an input field. If I paste an incorrect email address, that’s my own damn fault. I use tools like 1Password to remember all kinds of things for me, and it’s actually more error prone for me to type out all the characters than it is for me to copy from 1Password and paste into a text box.

Typical site message:

How to allow pasting password when blocked on Google Chrome

This is a dead simple Google Chrome extension that removes paste blocking. The code is as follows:

var allowPaste = function(e){
  e.stopImmediatePropagation();
  return true;
};
document.addEventListener('paste', allowPaste, true);

One can paste password when pasting into password input fields disabled on Google Chrome using above code. This code just allows the browser to accept all paste events, and skips any other paste event handlers. Pretty simple but effective solution.

Fig.01: Don’t f*ck with paste

Installation

To allow pasting into password input fields on Google Chrome browser:

  1. Open the Google Chrome browser.
  2. Visit this URL
  3. Click on “+ADD TO CHROME” green color button.
  4. Next add a site to the blacklist is to click on the extension icon. You may need edit the auto-generated pattern, finally click “Save
  5. Now you can copy the password from your password manager (such as gpass, keeppass and more) and paste it on any site.

I hope this tiny and open source extension save some time and frustration:

It annoys me to no end when a web application prevents me from being able to paste content into an input field, or copy it out. If I paste an incorrect email address, that’s my own damn fault. I use tools like 1Password to remember all kinds of things for me, and it’s actually more error prone for me to type out all the characters than it is for me to copy from 1Password and paste into a text box.

It worked on all of the sites that block pasting the password. These webmasters or site developers need to come up with user-friendly ways. Do not force us to type a random 50 character long password. The main reason many users try less secure and short password is stupid limitation added by developers. Security through obscurity is no security at all.

Firefox enable pasting password on sites that block it

Update: You can now use this addon on Firefox that stops websites from blocking copy and paste actions for password fields and other input fields.

Older solution

You need to use about:config which is a feature of Mozilla applications which lists application settings (known as preferences) that are read from the profile files prefs.js and user.js, and from application defaults. The following hack enables the password paste. In Firefox a type about:config in the Location Bar:
about:config
If you see a page with the warning message, This might void your warranty!, click the button labeled “I’ll be careful, I promise!“, to continue. Type the following in search bar:
dom.event.clipboardevents.enabled
And set dom.event.clipboardevents.enabled value to false by double clicking on it.

Conclusion

Both of these extensions are a dead simple solution for Google Chrome, Chromium and Mozilla Firefox that removes copy and paste blocking.

🐧 If you liked this page, please support my work on Patreon or with a donation.
🐧 Get the latest tutorials on SysAdmin, Linux/Unix, Open Source & DevOps topics via:
CategoryList of Unix and Linux commands
File Managementcat
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network Utilitiesdig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
3 comments… add one
  • soul_rebel Jan 16, 2016 @ 2:41

    I have this script saved as pastekeypresses and bound to Ctrl-Shift-V:

    #!/bin/sh
    sleep 2
    exec xte “str $(xclip -o)”
    https://publishers.disqus.com/learn
    Will paste anything directly into anything.

    • Alfredo Mar 6, 2016 @ 10:37

      Hi,
      I’m using centos 7 and debian 8. How do you bind the script to Ctrl-Shift-V?
      Nice hint.

  • Mark Aug 3, 2017 @ 6:29

    Note: Google Sheets’s “Copy(Ctrl+C) & Paste(Ctrl+V)” will be no function if we change “dom.event.clipboardevents.enabled” to false in Firefox.

Leave a Reply

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

Use HTML <pre>...</pre>, <code>...</code> and <kbd>...</kbd> for code samples.