Ultimate FPS Booster

Boosts the frame rate of websites to 200 FPS and no input delay

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name        Ultimate FPS Booster
// @namespace   Violentmonkey Scripts
// @match       *://*/*
// @grant       none
// @version     1.3
// @author      Your Name
// @description Boosts the frame rate of websites to 200 FPS and no input delay
// ==/UserScript==

(function() {
    'use strict';

    // List of CSS properties to modify
    const propertiesToModify = [
        'animation-duration',
        'transition-duration'
    ];

    // Boost factor (e.g., 2.0 for a 200% boost)
    const boostFactor = 2.0;

    // Function to modify CSS properties
    function modifyCSSProperty(property, value) {
        if (value.endsWith('s')) {
            const duration = parseFloat(value);
            const boostedDuration = duration * boostFactor;
            return boostedDuration + 's';
        }
        return value;
    }

    // Function to modify CSS styles
    function modifyCSSStyles(styles) {
        for (let i = 0; i < styles.length; i++) {
            const style = styles[i];
            const property = style.propertyName;
            const value = style.value;

            if (propertiesToModify.includes(property)) {
                const boostedValue = modifyCSSProperty(property, value);
                style.value = boostedValue;
            }
        }
    }

    // Observe DOM changes
    const observer = new MutationObserver((mutations) => {
        mutations.forEach((mutation) => {
            if (mutation.type === 'attributes') {
                const target = mutation.target;
                if (target.nodeType === Node.ELEMENT_NODE) {
                    const computedStyles = window.getComputedStyle(target);
                    modifyCSSStyles(computedStyles);
                }
            }
        });
    });

    // Start observing the entire document
    observer.observe(document, {
        attributes: true,
        subtree: true
    });
})();