Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save xiaoda/32d155aa3b1ebdf72e2f to your computer and use it in GitHub Desktop.
Save xiaoda/32d155aa3b1ebdf72e2f to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name Re-enable password pasting
// @namespace http://yechengfu.com
// @version 0.1
// @description Re-enable password pasting.
// @author Yecheng Fu
// @match https://accounts.ctrip.com/*
// @grant none
// @refer http://prioritized.net/blog/re-enabling-password-pasting-on-annoying-web-forms/
// ==/UserScript==
var inputs = document.getElementsByTagName('input');
for (var i=0; i < inputs.length; i++) {
if (inputs[i].getAttribute('type').toLowerCase() === 'password') {
inputs[i].setAttribute('onpaste', '');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment