您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Show/Hide Password when hovering over the input password
当前为
// ==UserScript== // @name Show/Hide Password // @version 1 // @description Show/Hide Password when hovering over the input password // @icon https://cdn-icons-png.flaticon.com/512/312/312404.png // @match *://*/* // @grant none // @license MIT // @unwrap // @namespace https://gf.zukizuki.org/users/821661 // ==/UserScript== (function () { "use strict"; function showPassword(node) { node.type = "text"; } function hidePassword(node) { node.type = "password"; } const observer = new MutationObserver((mutations) => { mutations.forEach((mutation) => { if (mutation.type === "childList" && mutation.addedNodes.length > 0) { mutation.addedNodes.forEach((node) => { if (node.tagName === "INPUT" && node.type === "password") { node.addEventListener("mouseover", () => { showPassword(node); }); node.addEventListener("focus", () => { showPassword(node); }); node.addEventListener("mouseout", () => { hidePassword(node); }); node.addEventListener("blur", () => { hidePassword(node); }); console.log("Input do tipo password adicionado:", node); } }); } }); }); observer.observe(document.body, { childList: true, subtree: true, }); })();