Password Revealer

By JoeSimmons Last update Jul 22, 2009 — Installed 2,037 times. Daily Installs: 7, 11, 8, 2, 6, 5, 4, 5, 9, 2, 4, 6, 11, 10, 8, 6, 8, 6, 3, 4, 3, 2, 4, 6, 7, 2, 8, 9, 5, 3, 6, 3

There are 7 previous versions of this script.

// ==UserScript==
// @name           Password Revealer
// @namespace      http://userscripts.org/users/23652
// @description    Shows passwords on mouse hover or focus
// @include        http://*
// @include        https://*
// @include        file:*
// @copyright      JoeSimmons
// @version        1.0.3
// @license        Creative Commons Attribution-Noncommercial 3.0 United States License
// ==/UserScript==

var show_only_on_click = false; //  Only show passwords when you click on the field

function text() {
this.type = "text";
}

function password() {
this.type = "password";
}

function addHandlers() {
var dp = document.evaluate("//input[@type='password']",document,null,6,null);
for(var i=dp.snapshotLength-1,DP; (DP=dp.snapshotItem(i)); i--) {
if(!show_only_on_click) {
DP.addEventListener("mouseover", text, false);
DP.addEventListener("mouseout", password, false);
} else {
DP.addEventListener("focus", text, false);
DP.addEventListener("blur", password, false);
}
}
}

addHandlers();