您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
滴滴滴滴!吵死你!
// ==UserScript== // @name 电报键盘! // @namespace https://pen-yo.github.io/ // @version 2023-12-25 // @description 滴滴滴滴!吵死你! // @author Penyo // @match **/* // @icon // @grant none // ==/UserScript== (function () { "use strict"; const max = 10; const unused = []; const using = []; const audio = new AudioContext(); function supply(arr) { const oscillator = audio.createOscillator(); oscillator.frequency.value = 1500; oscillator.connect(audio.destination); arr.push(oscillator); } function use(arr, key) { if (arr.length < 0) return; const o = arr.pop(); o.start(); using.push({ key: key, target: o, }); supply(arr); } for (let i = 0; i < max; i++) supply(unused); console.log(unused, using); document.addEventListener("keypress", (e) => { use(unused, e.code); }); document.addEventListener("keyup", (e) => { using.forEach((o) => { if (e.code == o.key) o.target.stop(); }); }); })();