// ==UserScript== // @name BattlefieldTracker 计时器清除器 // @namespace http://tampermonkey.net/ // @version 1.0 // @description 清除BattlefieldTracker网站上的自动刷新计时器 // @author Cindy-Master // @match https://battlefieldtracker.com/bf1/profile/* // @grant none // @run-at document-end // @license MIT // @downloadURL https://update.greasyfork.cloud/scripts/532892/BattlefieldTracker%20%E8%AE%A1%E6%97%B6%E5%99%A8%E6%B8%85%E9%99%A4%E5%99%A8.user.js // @updateURL https://update.greasyfork.cloud/scripts/532892/BattlefieldTracker%20%E8%AE%A1%E6%97%B6%E5%99%A8%E6%B8%85%E9%99%A4%E5%99%A8.meta.js // ==/UserScript== (function() { 'use strict'; function clearAllTimers() { console.log('正在清除所有计时器...'); let clearedTimers = 0; for(let i = 1; i < 9999; i++) { window.clearInterval(i); window.clearTimeout(i); clearedTimers++; } console.log('已清除' + clearedTimers + '个潜在计时器'); } function showNotification() { const indicator = document.createElement('div'); indicator.style.position = 'fixed'; indicator.style.bottom = '10px'; indicator.style.right = '10px'; indicator.style.background = 'rgba(0, 128, 0, 0.7)'; indicator.style.color = 'white'; indicator.style.padding = '5px 10px'; indicator.style.borderRadius = '5px'; indicator.style.fontSize = '12px'; indicator.style.zIndex = '9999'; indicator.textContent = '页面加载完毕,计时器已禁用'; document.body.appendChild(indicator); setTimeout(() => { indicator.style.opacity = '0'; indicator.style.transition = 'opacity 1s'; }, 5000); } window.addEventListener('load', function() { setTimeout(function() { clearAllTimers(); showNotification(); setInterval(clearAllTimers, 30000); }, 2000); }); })();