DeepSeek No Auto-Scroll

Block auto-scroll in DeepSeek while keeping manual scroll control

当前为 2025-03-16 提交的版本,查看 最新版本

  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.20250316192637
  6. // @namespace https://greasyfork.org/users/1435046
  7. // ==/UserScript==
  8.  
  9. (function() {
  10. 'use strict';
  11. const blockScroll = el => {
  12. Object.defineProperty(el, 'scrollTop', {
  13. set: () => {},
  14. get: () => el._realScroll || 0,
  15. configurable: true
  16. });
  17. el.addEventListener('scroll', () => el._realScroll = el.scrollTop);
  18. };
  19.  
  20. // Apply to existing elements
  21. document.querySelectorAll('*').forEach(blockScroll);
  22. // Watch for new elements
  23. new MutationObserver(muts => {
  24. muts.forEach(m => [...m.addedNodes]
  25. .filter(n => n.nodeType === 1)
  26. .forEach(blockScroll)
  27. );
  28. }).observe(document.documentElement, { subtree: true, childList: true });
  29. })();