Skip to content

Instantly share code, notes, and snippets.

@axemclion
Created January 6, 2018 15:58
Show Gist options
  • Select an option

  • Save axemclion/859eb3c86de66ec6add8e3ed49b011b6 to your computer and use it in GitHub Desktop.

Select an option

Save axemclion/859eb3c86de66ec6add8e3ed49b011b6 to your computer and use it in GitHub Desktop.

Revisions

  1. axemclion created this gist Jan 6, 2018.
    16 changes: 16 additions & 0 deletions showpassword.user.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,16 @@
    // ==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);
    }