Skip to content

Instantly share code, notes, and snippets.

@HaydenElza
Created April 5, 2024 20:35
Show Gist options
  • Save HaydenElza/713f99250313fe6f909ef1df83ac0904 to your computer and use it in GitHub Desktop.
Save HaydenElza/713f99250313fe6f909ef1df83ac0904 to your computer and use it in GitHub Desktop.
Re-enable paste in form input when disabled by website.

Allow Paste

Re-enable paste in form input when disabled by website.

var allowPaste = function(e) {
  e.stopImmediatePropagation();
  console.log("Free the paste!")
  return true;
};
document.addEventListener('paste', allowPaste, true);

Credit: When the Password Field Says No to Paste by Daniela Baron

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment