New script chatgpt.com

2/14/2025, 4:19:59 PM

当前为 2025-02-14 提交的版本,查看 最新版本

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