您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Greasy Fork is available in English.
密码框显示密码,支持懒加载、动态页面中的密码框,鼠标悬浮在密码框上时显示密码
当前为
// ==UserScript== // @name 星号密码框显示明文密码 // @namespace Violentmonkey Scripts // @match *://*/* // @grant none // @version 1.0 // @license MIT // @author - // @description 密码框显示密码,支持懒加载、动态页面中的密码框,鼠标悬浮在密码框上时显示密码 // ==/UserScript== (function() { 'use strict'; function bindPasswordEvents(input) { input.addEventListener('mouseenter', () => input.type = 'text'); input.addEventListener('mouseleave', () => input.type = 'password'); } function handleMutations(mutations) { mutations.forEach(mutation => { if (mutation.type === 'childList') { mutation.addedNodes.forEach(node => { if (node.nodeType === Node.ELEMENT_NODE) { // 直接检查节点是否是密码输入框 if (node.tagName === 'INPUT' && node.type === 'password') { bindPasswordEvents(node); } else { // 如果不是,检查其子节点 node.querySelectorAll('input[type="password"]').forEach(bindPasswordEvents); } } }); } }); } const observer = new MutationObserver(handleMutations); const config = { childList: true, subtree: true }; observer.observe(document, config); // 初始化现有密码输入框的事件绑定 document.querySelectorAll('input[type="password"]').forEach(bindPasswordEvents); })();