Hybrid Performance Booster

Balanced performance script with safe acceleration + optional aggressive mode.

目前為 2025-09-13 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         Hybrid Performance Booster
// @namespace    http://zeta/
// @version      3.5
// @description  Balanced performance script with safe acceleration + optional aggressive mode.
// @author       Gugu8
// @match        *://*/*
// @run-at       document-start
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // --- GPU Acceleration (Balanced) ---
    const enableGPU = () => {
        const targets = document.querySelectorAll('video, canvas, [style*="transform"], [style*="animation"]');
        for (const el of targets) {
            el.style.transform = 'translateZ(0)';
            el.style.willChange = 'transform, opacity';
        }
    };

    // --- Optional: Aggressive GPU Override (Uncomment to enable) ---
    // const enableAggressiveGPU = () => {
    //     document.querySelectorAll('*').forEach(el => {
    //         el.style.transform = 'translate3d(0,0,0)';
    //         el.style.willChange = 'transform, opacity';
    //     });
    // };

    // --- Performance UI (Smooth) ---
    const startPerformanceUI = () => {
        const ui = document.createElement('div');
        ui.id = 'perf-ui';
        ui.style.cssText = `
            position: fixed; bottom: 12px; right: 12px;
            background: #000; color: #0f0; font-family: monospace;
            padding: 10px; border: 1px solid #00ff00; border-radius: 5px;
            z-index: 99999; font-size: 12px;
        `;
        document.body.appendChild(ui);

        let fps = 0, lastTime = performance.now();
        const update = () => {
            const now = performance.now();
            fps = Math.round(1000 / (now - lastTime));
            lastTime = now;
            ui.innerHTML = `FPS: <strong>${fps}</strong> | MODE: HYBRID`;
            requestAnimationFrame(update);
        };
        update();
    };

    // --- Init ---
    document.addEventListener('DOMContentLoaded', () => {
        enableGPU();
        if ('requestIdleCallback' in window) {
            requestIdleCallback(startPerformanceUI);
        } else {
            setTimeout(startPerformanceUI, 1000);
        }
    });

})();