您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
try to protect your password input!
当前为
- // ==UserScript==
- // @name Password Input Protector
- // @namespace http://tampermonkey.net/
- // @version 1.0
- // @description try to protect your password input!
- // @author HeziCyan
- // @include *
- // @icon https://www.google.com/s2/favicons?domain=219.58
- // @grant none
- // @license GPL
- // ==/UserScript==
- (function() {
- 'use strict';
- window.addEventListener('load', function() {
- let inputs = document.getElementsByTagName('input')
- let pass = new Array
- for (let input of inputs) {
- if (input.type === 'password') pass.push(input)
- }
- const callback = function(mutationsList, observer) {
- for (let mutation of mutationsList) {
- if (mutation.type === 'attributes') {
- let target = mutation.target
- if (target.type !== 'password') {
- target.type = 'password'
- alert('请不要试图修改密码框的 type 属性!')
- }
- }
- }
- }
- const config = { attributes: true }
- let observer = new MutationObserver(callback)
- for (let ele of pass) observer.observe(ele, config)
- })
- })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址