您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Toggle microphone on double-click
当前为
// ==UserScript== // @name Microphone Toggle Addon // @version 1.0 // @description Toggle microphone on double-click // @author Bort // @match https://tinychat.com/room/* // @match https://tinychat.com/* // @grant none // @run-at document-end // @namespace https://greasyfork.org/users/1024912 // ==/UserScript== (function() { 'use strict'; // Function to handle double-click on the microphone button function toggleMicrophone() { let micButton = document.querySelector('button.mic-button'); // Adjust the selector to match the microphone button if (!micButton) { console.error('Microphone button not found'); return; } let micState = false; // False: Mic is off, True: Mic is on micButton.addEventListener('dblclick', () => { micState = !micState; if (micState) { openMicrophone(); } else { closeMicrophone(); } }); } // Function to open the microphone function openMicrophone() { let micButton = document.querySelector('button.mic-button'); // Adjust the selector to match the microphone button if (micButton) { micButton.click(); console.log('Microphone opened'); } } // Function to close the microphone function closeMicrophone() { let micButton = document.querySelector('button.mic-button'); // Adjust the selector to match the microphone button if (micButton) { micButton.click(); console.log('Microphone closed'); } } // Initialize the script after the page is fully loaded window.addEventListener('load', toggleMicrophone); })();