您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Aligns the sell action text to the right and auto-clicks the Close button on Torn.com item page
当前为
// ==UserScript== // @name Torn.com Align Sell Action Right & Auto Close // @namespace http://tampermonkey.net/ // @version 1.1 // @description Aligns the sell action text to the right and auto-clicks the Close button on Torn.com item page // @author Slaterz [2479416] // @match https://www.torn.com/item.php* // @grant none // @license MIT // ==/UserScript== (function() { 'use strict'; // Function to align text to the right function alignSellActionText() { const sellActElements = document.querySelectorAll('.action-wrap.sell-act'); sellActElements.forEach(element => { element.style.textAlign = 'right'; }); } // Function to auto-click the "Close" button function autoClickClose() { const closeButton = document.querySelector('.action-wrap.sell-act .close-act'); if (closeButton) { closeButton.click(); console.log('Clicked the close button automatically.'); } } // Combine both functions function handleSellAction() { alignSellActionText(); autoClickClose(); } // Run the function when the page loads window.addEventListener('load', handleSellAction); // Run the function when the page content changes (for Torn's dynamic content) const observer = new MutationObserver(handleSellAction); observer.observe(document.body, { childList: true, subtree: true }); })();