Re-enabling Password Pasting on Annoying Web Forms

As a 1password user, I usually have very long, unique, and random passwords for every site that requires one. I use the 1Password browser extensions to fill password forms for me, but on iOS I copy and paste the values manually. Some misguided web developers have decided pasting passwords should be prohibited and have added onpaste events to prevent it. The latest culprit I have encountered is Apple.

While this is an infrequent annoyance it can be crippling. To combat it, I whipped up a bookmarklet that will run some JavaScript on the page to remove onpaste events from all password fields.

To use the bookmarklet, drag the allow pwpaste bookmarklet link to your bookmark toolbar. When you encounter one of these annoying forms, simply click the bookmark to re-enable pasting. The bookmarklet source is available in a more readable format below.

Adding bookmarkelts to mobile safari is a giant pain, so I would suggest adding the bookmarklet in desktop Safari and using iCloud to sync it.

var inputs = document.getElementsByTagName('input');  
for (var i=0; i < inputs.length; i++) {  
  if (inputs[i].getAttribute('type').toLowerCase() === 'password') {
    inputs[i].setAttribute('onpaste', '');


About the Author

Derek Prior Image

Derek Prior


I'm a developer at thoughtbot in Boston. When not at a computer, I can be found playing with my kids, riding my bike, or taking recreational sports way too seriously. I do not know how to hockey stop.