您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Double click toggles password to text field and back
- // ==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);
- }