Created
June 27, 2015 03:56
-
-
Save rummik/fe33303af585ce3be0fb to your computer and use it in GitHub Desktop.
Fix stupid `onpaste="false"` password fields. >.>
This file contains hidden or 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 Allow password paste | |
// @namespace http://www.rummik.com/ | |
// @version 0.1 | |
// @description Removes paste event from elements with `onpaste` set | |
// @author rummik | |
// @match http://*/* | |
// @match https://*/* | |
// @grant none | |
// ==/UserScript== | |
[].slice.apply(document.querySelectorAll('input[type=password]')) | |
.forEach(function(ele) { | |
if (typeof ele.onpaste == 'function' && /return false/.test(ele.onpaste.toString())) { | |
ele.onpaste = new Function(); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment