Skip to content

Instantly share code, notes, and snippets.

@axemclion
Created January 6, 2018 15:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save axemclion/859eb3c86de66ec6add8e3ed49b011b6 to your computer and use it in GitHub Desktop.
Save axemclion/859eb3c86de66ec6add8e3ed49b011b6 to your computer and use it in GitHub Desktop.
Greasemonkey script to show password on doubleclick
// ==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