Skip to content

Instantly share code, notes, and snippets.

@cofyc
Created January 4, 2015 16:48
Show Gist options
  • Save cofyc/bea0957011df6954e42a to your computer and use it in GitHub Desktop.
Save cofyc/bea0957011df6954e42a to your computer and use it in GitHub Desktop.
Re-enable password pasting
// ==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', '');
}
}
@cofyc
Copy link
Author

cofyc commented Jan 4, 2015

使用时,注意修改 @match 为你要应用的站点。

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