您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Adds a button to toggle the width of the chat and the size of images on StumbleChat rooms
当前为
// ==UserScript== // @name StumbleChat Width Toggle // @namespace http://tampermonkey.net/ // @version 0.3 // @description Adds a button to toggle the width of the chat and the size of images on StumbleChat rooms // @author You // @match https://stumblechat.com/room/* // @grant none // ==/UserScript== (function() { 'use strict'; // Select the sc-chat element var chatElement = document.querySelector('sc-chat'); // Check if the element exists if (chatElement) { // Create a button element var toggleButton = document.createElement('button'); toggleButton.innerText = 'Toggle Width'; toggleButton.style.position = 'fixed'; toggleButton.style.top = '10px'; toggleButton.style.right = '10px'; toggleButton.style.zIndex = '1000'; toggleButton.style.color = 'black'; toggleButton.style.background = '#33FF3380'; toggleButton.style.borderRadius = '5px'; // Add the button to the document document.body.appendChild(toggleButton); // Add a click event listener to the button toggleButton.addEventListener('click', function() { // Toggle the width of the chat if (chatElement.style.width === '2000px') { chatElement.style.width = '500px'; } else { chatElement.style.width = '2000px'; // Set the width and height of images in the message-content class to twice their current size var images = document.querySelectorAll('.message-content img'); images.forEach(function(image) { image.width *= 2; image.height *= 2; }); } }); } })();