Created
January 6, 2018 15:58
-
-
Save axemclion/859eb3c86de66ec6add8e3ed49b011b6 to your computer and use it in GitHub Desktop.
Greasemonkey script to show password on doubleclick
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 Show Password | |
// @version 1 | |
// @grant none | |
// ==/UserScript== | |
function handleDblClick(e){ | |
var pwd = e.target; | |
var type = pwd.getAttribute('type'); | |
pwd.setAttribute('type', type === 'password' ? 'text': 'password'); | |
} | |
var passwords = document.querySelectorAll("input[type=password]"); | |
for (var i = 0; i < passwords.length; i++){ | |
passwords[i].addEventListener('dblclick', handleDblClick, true); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment