How to allow pasting password when blocked on Google Chrome

last updated in Categories Howto, Linux News, Open Source, Programming

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.

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 Enable Pasting Text on Sites That Block It

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
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
    This add-on stops websites from blocking copy and paste for password fields and other input fields.
  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.

Posted by: Vivek Gite

The author is the creator of nixCraft and a seasoned sysadmin, DevOps engineer, and a trainer for the Linux operating system/Unix shell scripting. Get the latest tutorials on SysAdmin, Linux/Unix and open source topics via RSS/XML feed or weekly email newsletter.

Start the discussion at www.nixcraft.com

Historical Comment Archive

3 comment

  1. 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.

Comments are closed.