您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Toggle all item listings anonymous ON/OFF while keeping manual control
当前为
// ==UserScript== // @name Torn Auto-Anon Toggle (Full Control) // @namespace http://tampermonkey.net/ // @version 1.3 // @description Toggle all item listings anonymous ON/OFF while keeping manual control // @match https://www.torn.com/page.php?sid=ItemMarket* // @grant none // @run-at document-idle // ==/UserScript== (function () { 'use strict'; let autoAnon = true; // Create toggle button const toggleBtn = document.createElement('button'); toggleBtn.textContent = 'Auto-Anon: ON'; Object.assign(toggleBtn.style, { position: 'fixed', top: '50%', left: '10px', transform: 'translateY(-50%)', zIndex: '9999', padding: '8px 12px', backgroundColor: '#222', color: '#0f0', border: '2px solid #0f0', borderRadius: '6px', fontSize: '14px', cursor: 'pointer', opacity: 0.9, }); toggleBtn.onclick = () => { autoAnon = !autoAnon; toggleBtn.textContent = `Auto-Anon: ${autoAnon ? 'ON' : 'OFF'}`; toggleBtn.style.color = autoAnon ? '#0f0' : '#f00'; toggleBtn.style.borderColor = autoAnon ? '#0f0' : '#f00'; applyToAllVisible(); }; document.body.appendChild(toggleBtn); // Tick/Untick all visible checkboxes function applyToAllVisible() { const allBoxes = document.querySelectorAll('input[id^="itemRow-incognitoCheckbox-"]'); allBoxes.forEach(box => { if (autoAnon && !box.checked) { box.click(); } else if (!autoAnon && box.checked) { box.click(); } }); } // Observer for new rows const observer = new MutationObserver(mutations => { for (let mutation of mutations) { for (let node of mutation.addedNodes) { if (!(node instanceof HTMLElement)) continue; const checkboxes = node.querySelectorAll?.('input[id^="itemRow-incognitoCheckbox-"]') || []; checkboxes.forEach(checkbox => { if (autoAnon && !checkbox.checked) { checkbox.click(); } else if (!autoAnon && checkbox.checked) { checkbox.click(); } }); } } }); function initObserver() { if (location.hash.startsWith('#/addListing')) { observer.observe(document.body, { childList: true, subtree: true }); applyToAllVisible(); // First batch } } window.addEventListener('hashchange', initObserver); window.addEventListener('load', initObserver); initObserver(); })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址