Greasy Fork 还支持 简体中文。

ChatGPT No Auto-Scroll

removes auto-scroll on chatgpt

  1. // ==UserScript==
  2. // @name ChatGPT No Auto-Scroll
  3. // @description removes auto-scroll on chatgpt
  4. // @match https://chatgpt.com/*
  5. // @version 0.0.1.20250513035702
  6. // @namespace Violentmonkey Scripts
  7. // ==/UserScript==
  8.  
  9. // Function to remove min-height and disable auto-scroll
  10. function fixElement(element) {
  11. element.style.minHeight = 'auto'; // Remove forced min-height
  12. element.scrollIntoView = () => {}; // Disable auto-scroll
  13. }
  14.  
  15. // Apply to existing elements
  16. document.querySelectorAll('[data-testid^="conversation-turn-"]').forEach(fixElement);
  17.  
  18. // Observer for new dynamically added elements
  19. const observer = new MutationObserver((mutations) => {
  20. mutations.forEach((mutation) => {
  21. mutation.addedNodes.forEach((node) => {
  22. if (node.nodeType === 1 && node.matches('[data-testid^="conversation-turn-"]')) {
  23. fixElement(node);
  24. }
  25. });
  26. });
  27. });
  28.  
  29. observer.observe(document.body, { childList: true, subtree: true });
  30.  
  31. console.log("Removed min-height and disabled auto-scroll for all chat elements.");