Created
January 4, 2015 16:48
-
-
Save cofyc/bea0957011df6954e42a to your computer and use it in GitHub Desktop.
Re-enable password pasting
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==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
使用时,注意修改 @match 为你要应用的站点。