Show Password onMouseOver

By LouCypher Last update Oct 6, 2005 — Installed 15,489 times. Daily Installs: 13, 10, 14, 6, 6, 15, 3, 16, 10, 13, 11, 10, 5, 5, 5, 10, 9, 4, 8, 7, 9, 12, 12, 9, 8, 16, 24, 9, 11, 11, 14, 2
// ==UserScript==
// @name          Show Password onMouseOver
// @namespace     http://zoolcar9.lhukie.net/
// @include       *
// @description	  Show password when mouseover on password field
// ==/UserScript==
// Changelog:
// - 20051010: used XPath;

(function() {
  var inputs, input;
  inputs = document.evaluate(
    '//input[@type="password"]',
    document,
    null,
    XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,
    null);
  if(!inputs.snapshotLength) return;
  for(var i = 0; i < inputs.snapshotLength; i++) {
    input = inputs.snapshotItem(i);
    input.addEventListener('mouseover', function(event) {
      this.type = 'text';
    }, false);
    input.addEventListener('mouseout', function(event) {
      this.type = 'password';
    }, false);
  }
})();