Deepseek No Auto-Scroll (Stable)

Robust scroll blocking with multiple fallbacks

2025-03-16 या दिनांकाला. सर्वात नवीन आवृत्ती पाहा.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey, Greasemonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्क्रिप्ट व्यवस्थापक एक्स्टेंशन इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्क्रिप्ट व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्टाईल व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

// ==UserScript==
// @name         Deepseek No Auto-Scroll (Stable)
// @description  Robust scroll blocking with multiple fallbacks
// @match        *://*.deepseek.com/*
// @version 0.0.1.20250316190240
// @namespace https://greatest.deepsurf.us/users/1435046
// ==/UserScript==

(function() {
    'use strict';
    
    const SCROLL_SELECTORS = [
        '[class*="overflow-auto"]', // Class contains "overflow-auto"
        '[class*="scroll-container"]', // Class contains "scroll-container"
        'main > div > div', // Structural fallback
        'div[style*="overflow"]' // Inline style overflow
    ];

    let activeContainer = null;

    const blockScroll = (container) => {
        if(container.__scrollBlocked) return;
        
        // Nuclear option: Remove all scroll behaviors
        container.style.overflow = 'hidden !important';
        container.style.overscrollBehavior = 'none !important';
        
        // Block all scroll methods
        const scrollMethods = ['scrollTo', 'scrollBy', 'scrollIntoView'];
        scrollMethods.forEach(method => {
            container[method] = () => {};
        });

        // Prevent wheel/touch events
        container.addEventListener('wheel', e => e.stopPropagation(), true);
        container.addEventListener('touchmove', e => e.stopPropagation(), true);
        
        container.__scrollBlocked = true;
    };

    const findScrollContainer = () => {
        return SCROLL_SELECTORS.reduce((found, selector) => {
            return found || document.querySelector(selector);
        }, null);
    };

    const initScrollBlock = () => {
        const newContainer = findScrollContainer();
        if(newContainer && newContainer !== activeContainer) {
            activeContainer = newContainer;
            blockScroll(newContainer);
        }
    };

    // Run every 500ms + on mutations
    setInterval(initScrollBlock, 500);
    new MutationObserver(initScrollBlock).observe(document.body, {
        childList: true,
        subtree: true,
        attributes: true
    });
})();