您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
generates a random string
当前为
// ==UserScript== // @name random string generator // @namespace http://tampermonkey.net/ // @version 0.1 // @description generates a random string // @license MIT // @author joshclark756 // @include http://*/* // @include https://*/* // @grant none // ==/UserScript== function getRandomString(length) { const charset = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'; let randomString = ''; for (let i = 0; i < length; i++) { const randomIndex = Math.floor(Math.random() * charset.length); randomString += charset[randomIndex]; } return randomString; } function detectSelectedInput() { return document.activeElement; } document.addEventListener('keydown', function(event) { if (event.key === 'Insert') { const selectedInput = detectSelectedInput(); if (selectedInput) { const randomString = getRandomString(10); // Change the length as needed selectedInput.value = randomString; } } });