Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Greasemonkey script to show password on doubleclick
// ==UserScript==
// @name Show Password
// @version 1
// @grant none
// ==/UserScript==
function handleDblClick(e){
var pwd =;
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