您需要先安装一个扩展,例如 篡改猴、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.3 // @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, but only after confirmation function autoClickClose() { const confirmationText = document.querySelector('.action-wrap.sell-act p'); const closeButton = document.querySelector('.action-wrap.sell-act .close-act'); // Only click close if the confirmation message is displayed if (confirmationText && confirmationText.textContent.includes('You sold your')) { if (closeButton) { closeButton.click(); console.log('Clicked the close button automatically after selling the item.'); } } } // Function to handle clicking "Yes" to confirm the sale function handleSellConfirmation() { const yesButton = document.querySelector('.action-wrap.sell-act .next-act.bold.t-blue.h'); if (yesButton) { yesButton.addEventListener('click', () => { // Wait a moment to let the sale process and then attempt to auto-close setTimeout(autoClickClose, 300); }); } } // Combine both functions function handleSellAction() { alignSellActionText(); handleSellConfirmation(); } // 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 }); })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址