DeepSeek No Auto-Scroll

Block auto-scroll in DeepSeek while keeping manual scroll control

Verze ze dne 14. 05. 2025. Zobrazit nejnovější verzi.

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

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

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

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

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

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.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name         DeepSeek No Auto-Scroll
// @description  Block auto-scroll in DeepSeek while keeping manual scroll control
// @match        *://*.deepseek.com/*
// @version 0.0.1.20250514120038
// @namespace https://greasyfork.org/users/1435046
// ==/UserScript==

(function() {
    'use strict';

    // Function to apply the scroll behavior override
    function applyNoAutoScroll(scrollContainer) {
        // Block auto-scroll attempts while keeping manual control
        Object.defineProperty(scrollContainer, 'scrollTop', {
            set: function() {}, // Empty setter blocks programmatic scroll
            get: () => scrollContainer._realScrollTop || 0, // Preserve actual position
            configurable: true
        });

        // Store real scroll position
        scrollContainer.addEventListener('scroll', () => {
            scrollContainer._realScrollTop = scrollContainer.scrollTop;
        });
    }

    // Watch for the target element using MutationObserver
    const observer = new MutationObserver(() => {
        const scrollContainer = document.querySelector('div._8f60047');
        if (scrollContainer) {
            observer.disconnect(); // Stop observing once the element is found
            applyNoAutoScroll(scrollContainer);
        }
    });

    // Start observing the DOM for changes
    observer.observe(document.body, { childList: true, subtree: true });
})();