Show Password on Double Click

Double click toggles password to text field and back

Dovrai installare un'estensione come Tampermonkey, Greasemonkey o Violentmonkey per installare questo script.

You will need to install an extension such as Tampermonkey to install this script.

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Userscripts per installare questo script.

Dovrai installare un'estensione come ad esempio Tampermonkey per installare questo script.

Dovrai installare un gestore di script utente per installare questo script.

(Ho già un gestore di script utente, lasciamelo installare!)

Advertisement:

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

(Ho già un gestore di stile utente, lasciamelo installare!)

Advertisement:

// ==UserScript==
// @name           Show Password on Double Click
// @namespace      myfonj
// @description    Double click toggles password to text field and back
// @include        *
// @grant          none
// @license        CC0
// @version        2.0.3
// ==/UserScript==

// https://greasyfork.org/en/scripts/431017/versions/new

if(!document.body || !document.body.addEventListener || !WeakSet) {
  return
}

const swapped = new WeakSet();

document.body.addEventListener('dblclick', swap, true);

function swap(e) {
  const tgt = e.target;
  if( swapped.has(tgt) ) {
    tgt.type = 'password';
    swapped.delete(tgt);
    return
  }
  if ('INPUT' != tgt.tagName || 'password' != tgt.type) {
    return
  }
  tgt.type = 'text';
  swapped.add(tgt);
}