DeepSeek No Auto-Scroll

Block auto-scroll in DeepSeek while keeping manual scroll control

  1. // ==UserScript==
  2. // @name DeepSeek No Auto-Scroll
  3. // @description Block auto-scroll in DeepSeek while keeping manual scroll control
  4. // @match *://*.deepseek.com/*
  5. // @version 0.0.1.20250514122428
  6. // @namespace https://greasyfork.org/users/1435046
  7. // ==/UserScript==
  8.  
  9. (function() {
  10. 'use strict';
  11.  
  12. function applyNoAutoScroll(scrollContainer) {
  13. Object.defineProperty(scrollContainer, 'scrollTop', {
  14. set: function() {},
  15. get: () => scrollContainer._realScrollTop || 0,
  16. configurable: true
  17. });
  18. scrollContainer.addEventListener('scroll', () => {
  19. scrollContainer._realScrollTop = scrollContainer.scrollTop;
  20. });
  21. }
  22.  
  23. // Create and start one observer
  24. const observer = new MutationObserver(() => {
  25. const scrollContainers = document.querySelectorAll('div.scrollable');
  26. scrollContainers.forEach(container => {
  27. if (!container._noAutoScrollApplied) {
  28. container._noAutoScrollApplied = true;
  29. applyNoAutoScroll(container);
  30. }
  31. });
  32. });
  33. observer.observe(document.body, { childList: true, subtree: true });
  34.  
  35. // Also run once immediately in case containers already exist
  36. document.querySelectorAll('div.scrollable').forEach(container => {
  37. if (!container._noAutoScrollApplied) {
  38. container._noAutoScrollApplied = true;
  39. applyNoAutoScroll(container);
  40. }
  41. });
  42. })();