Greasy Fork

鼠标悬浮查看密码

鼠标悬浮在密码框,显示密码,移除恢复。

当前为 2023-04-30 提交的版本,查看 最新版本

// ==UserScript==
// @name         鼠标悬浮查看密码
// @namespace    http://tampermonkey.net/
// @version      0.0.2
// @description  鼠标悬浮在密码框,显示密码,移除恢复。
// @author       Blazing
// @include      *
// @license      MIT
// ==/UserScript==

(function () {
    var passwordFields = document.querySelectorAll("input[type='password']");
    passwordFields.forEach(function(field) {
        field.addEventListener("mouseover", function() {
            field.type = "text";
        });
        field.addEventListener("mouseout", function() {
            field.type = "password";
        });
    });

})();