您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Boost Chrome performance for Tank Trouble game by disabling certain features
当前为
// ==UserScript== // @name Tank Trouble Booster // @namespace http://tampermonkey.net/ // @version 0.0.2 // @license GPL-3.0 // @description Boost Chrome performance for Tank Trouble game by disabling certain features // @author kamarov // @match https://tanktrouble.com/* // @grant none // ==/UserScript== // Disable unnecessary features function disableFeatures() { // Disable Chrome PDF Viewer chrome.plugins.mv = null; // Disable automatic tab discarding chrome.experimental.tabDiscarding = false; // Suspend unused tabs to free up resources chrome.tabs.query({}, function(tabs) { tabs.forEach(function(tab) { if (tab.url.indexOf("tanktrouble.com") === -1) { chrome.tabs.discard(tab.id); } }); }); // Reduce JavaScript timer frequency for background tabs chrome.extension.getBackgroundPage().setTimeout(function() { setInterval(function() { if (document.hidden) { // Adjust the delay interval to your preference (in milliseconds) // Higher values reduce CPU usage but may impact real-time updates setTimeout(function() {}, 300); } }, 1000); }, 5000); // Additional optimizations // Disable image animations const disableImageAnimations = () => { const images = document.querySelectorAll("img"); images.forEach((img) => { img.style.animation = "none"; }); }; // Disable CSS animations const disableCSSAnimations = () => { const stylesheets = document.styleSheets; stylesheets.forEach((sheet) => { try { const rules = sheet.cssRules; rules.forEach((rule) => { if (rule.type === CSSRule.KEYFRAMES_RULE) { sheet.deleteRule(rule.name); } }); } catch (error) { console.log("Error accessing stylesheet: " + error); } }); }; disableImageAnimations(); disableCSSAnimations(); } // Call the function to disable features disableFeatures();