// ==UserScript== // @name 密码查看器 // @namespace http://tampermonkey.net/ // @version 0.0.3 // @description 密码查看器:针对于浏览器已经保存的密码进行查看,使用方法:1、点击油猴插件图标:密码-开启 - 密码-关闭 2、单手快捷键:“o”“p” // @author wll // @require https://cdn.jsdelivr.net/npm/jquery@3.6.0/dist/jquery.min.js // @icon https://img-blog.csdnimg.cn/20181221195058594.gif // @match *://*/* // @grant GM_registerMenuCommand // @run-at document-start // @note 授权联系: leiwang2010@163.com // @note 版本更新 20-12-22 0.0.1 针对于浏览器已经保存的密码进行查看,使用方法:点击油猴插件图标:密码-开启 - 密码-关闭 // @note 版本更新 20-12-23 0.0.2 增加密码框自动识别,用于解密使用 // @note 版本更新 20-12-24 0.0.3 优化代码性能,增加单手快捷键:“o”“p” // @downloadURL none // ==/UserScript== (function() { 'use strict'; document.addEventListener("keypress", function(e) { console.log("--->e.key:"+e.key); switch (e.key.toLowerCase()) { case "o": $('input[type=password]').attr("type", "1"); break; case "p": $('input[type=1]').attr("type", "password"); break; } }); function initMenu(){ if($('input[type=password]').length>0){ GM_registerMenuCommand('密码-开启', () => { $('input[type=password]').attr("type", "1"); }); GM_registerMenuCommand('密码-关闭', () => { $('input[type=1]').attr("type", "password"); }); } } initMenu(); })();