Disable animations

Speed up browsing by disabling CSS and JavaScript animations

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey, το Greasemonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

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

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Userscripts για να εγκαταστήσετε αυτόν τον κώδικα.

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

Θα χρειαστεί να εγκαταστήσετε μια επέκταση διαχείρισης κώδικα χρήστη για να εγκαταστήσετε αυτόν τον κώδικα.

(Έχω ήδη έναν διαχειριστή κώδικα χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Έχω ήδη έναν διαχειριστή στυλ χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

// ==UserScript==
// @name        Disable animations
// @description Speed up browsing by disabling CSS and JavaScript animations
// @version     2026.01.29
// @author      Claude Sonnet 4.5
// @grant       none
// @inject-into auto
// @run-at      document-start
// @match       *://*/*
// @namespace https://greasyfork.org/users/1519047
// ==/UserScript==

(function() {
    'use strict';

    // Disable CSS animations and transitions
    const injectCSS = () => {
        const style = document.createElement('style');
        style.id = 'disable-animations-style';
        style.textContent = `
            *, *::before, *::after {
                animation-duration: 0ms !important;
                animation-delay: 0ms !important;
                animation-timing-function: step-start !important;

                transition-duration: 0ms !important;
                transition-delay: 0ms !important;
                transition-timing-function: step-start !important;

                scroll-behavior: auto !important;
            }
        `;

        const target = document.head || document.documentElement;
        if (target && !document.getElementById('disable-animations-style')) {
            target.appendChild(style);
        }
    };

    // Inject CSS as early as possible
    if (document.documentElement) {
        injectCSS();
    } else {
        // Fallback if documentElement isn't ready
        const observer = new MutationObserver(() => {
            if (document.documentElement) {
                injectCSS();
                observer.disconnect();
            }
        });
        observer.observe(document, { childList: true });
    }

    // Disable JavaScript animations
    const disableJSAnimations = () => {
        try {
            // Disable jQuery animations
            const jQueryInstances = [
                window.jQuery,
                window.$ && window.$.fx ? window.$ : null,
                window.wrappedJSObject?.jQuery,
                window.wrappedJSObject?.$ && window.wrappedJSObject.$.fx ? window.wrappedJSObject.$ : null
            ];

            jQueryInstances.forEach(jq => {
                if (jq && jq.fx) {
                    jq.fx.off = true;
                }
            });

            // Disable Velocity.js animations
            if (window.Velocity) {
                window.Velocity.mock = true;
            }
            if (window.wrappedJSObject?.Velocity) {
                window.wrappedJSObject.Velocity.mock = true;
            }

            // Override requestAnimationFrame to reduce animation callbacks (optional, aggressive)
            // Uncomment if you want even more aggressive animation blocking:
            /*
            const originalRAF = window.requestAnimationFrame;
            window.requestAnimationFrame = function(callback) {
                return originalRAF.call(this, function(timestamp) {
                    callback(timestamp);
                });
            };
            */
        } catch (e) {
            console.debug('Animation disabler: Error disabling JS animations', e);
        }
    };

    // Run JS animation disabling on load and periodically check
    if (document.readyState === 'loading') {
        document.addEventListener('DOMContentLoaded', disableJSAnimations);
    } else {
        disableJSAnimations();
    }

    window.addEventListener('load', disableJSAnimations);

    // Re-check after a delay in case jQuery loads late
    setTimeout(disableJSAnimations, 1000);
})();