Show Password on Double Click

Double click toggles password to text field and back

目前为 2021-08-18 提交的版本。查看 最新版本

// ==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.1
// ==/UserScript==

// https://gf.qytechs.cn/en/scripts/431017/versions/new

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

var swappedFields = new Map();

function swap(e) {
  var t = e.target;
  if(swappedFields.get(t) == true) {
    t.type = 'password';
    swappedFields.delete(t);
    return
  }
  if ('INPUT' != t.tagName || 'password' != t.type) {
    return
  }
  t.type = 'text';
  swappedFields.set(t, true);
}

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

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址