Greasy Fork is available in English.

Universal Webpage Panic Mode

Instantly freeze animations, mute/pause media, and kill all running scripts/timers via a hotkey (Ctrl + Shift + X).

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği yüklemek için Tampermonkey gibi bir uzantı yüklemeniz gerekir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği indirebilmeniz için ayrıca Tampermonkey gibi bir eklenti kurmanız gerekmektedir.

Bu betiği yüklemek için bir betik yöneticisi eklentisi yüklemeniz gerekecektir.

(Zaten bir betik yöneticim var, hadi yükleyelim!)

Advertisement:

Bu stili yüklemek için Stylus gibi bir uzantı yüklemeniz gerekir.

Bu stili yüklemek için Stylus gibi bir uzantı kurmanız gerekir.

Bu stili yükleyebilmek için Stylus gibi bir uzantı yüklemeniz gerekir.

Bu stili yüklemek için bir kullanıcı stili yöneticisi uzantısı yüklemeniz gerekir.

Bu stili yüklemek için bir kullanıcı stili yöneticisi uzantısı kurmanız gerekir.

Bu stili yükleyebilmek için bir kullanıcı stili yöneticisi uzantısı yüklemeniz gerekir.

(Zateb bir user-style yöneticim var, yükleyeyim!)

Advertisement:

// ==UserScript==
// @name         Universal Webpage Panic Mode
// @namespace    https://github.com
// @version      1.1
// @description  Instantly freeze animations, mute/pause media, and kill all running scripts/timers via a hotkey (Ctrl + Shift + X).
// @author       Your Name
// @match        *://*/*
// @grant        none
// @run-at       document-start
// ==/UserScript==

(function() {
    'use strict';

    // Unique ID for the panic mode elements
    const ID = '__bm_panic_mode';
    const NOTICE_ID = '__bm_panic_notice';

    // The main function that triggers panic mode
    function triggerPanicMode() {
        // Toggle off if already active
        if (document.getElementById(ID)) {
            document.getElementById(ID).remove();
            const oldNotice = document.getElementById(NOTICE_ID);
            if (oldNotice) oldNotice.remove();
            alert('Panic mode visual rules removed. Note: Cleared timers cannot be restored automatically.');
            return;
        }

        // 1. Inject aggressive CSS to freeze all visual movements
        const style = document.createElement('style');
        style.id = ID;
        style.textContent = `
            * {
                animation: none !important;
                transition: none !important;
            }
            img, video, iframe, canvas {
                animation: none !important;
                transition: none !important;
            }
            body {
                backface-visibility: hidden !important;
                -webkit-backface-visibility: hidden !important;
            }
        `;
        (document.head || document.documentElement).appendChild(style);

        // 2. Mute, pause, and stop loading all HTML5 media elements
        try {
            Array.from(document.querySelectorAll('video, audio')).forEach(media => {
                try {
                    media.pause();
                    media.muted = true;
                    media.preload = 'none';
                } catch (e) {}
            });
        } catch (e) {}

        // 3. Destructive timer wipeout (Nuke loops and timeouts)
        try {
            const probe = setInterval(() => {}, 1000);
            const maxId = probe;
            clearInterval(probe);

            // Fixed syntax: added + operators for the loop and increment
            for (let i = 0; i <= maxId + 1000; i++) {
                try {
                    clearInterval(i);
                    clearTimeout(i);
                } catch (e) {}
            }
        } catch (e) {}

        console.log('Panic Mode Activated: Page activity frozen.');
    }

    // 4. Keyboard Shortcut Listener
    // Note: Changed from Ctrl+Shift+Escape (reserved by Windows for Task Manager) to Ctrl+Shift+X
    window.addEventListener('keydown', function(event) {
        if (event.ctrlKey && event.shiftKey && event.key.toLowerCase() === 'x') {
            event.preventDefault();
            triggerPanicMode();
        }
    }, true); // Using capture phase to intercept events early
})();