DeepSeek No Auto-Scroll

Block auto-scroll in DeepSeek while keeping manual scroll control

As of 2025-03-16. See the latest version.

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

(function() {
    'use strict';
    
    const blockScroll = el => {
        Object.defineProperty(el, 'scrollTop', {
            set: () => {}, 
            get: () => el._realScroll || 0,
            configurable: true
        });
        el.addEventListener('scroll', () => el._realScroll = el.scrollTop);
    };

    // Apply to existing elements
    document.querySelectorAll('*').forEach(blockScroll);
    
    // Watch for new elements
    new MutationObserver(muts => {
        muts.forEach(m => [...m.addedNodes]
            .filter(n => n.nodeType === 1)
            .forEach(blockScroll)
        );
    }).observe(document.documentElement, { subtree: true, childList: true });
})();