ChatGPT No Auto-Scroll

removes auto-scroll on chatgpt

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

ستحتاج إلى تثبيت إضافة مثل Stylus لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتتمكن من تثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

(لدي بالفعل مثبت أنماط للمستخدم، دعني أقم بتثبيته!)

// ==UserScript==
// @name        ChatGPT No Auto-Scroll
// @description removes auto-scroll on chatgpt
// @match       https://chatgpt.com/*
// @version 0.0.1.20250513035702
// @namespace Violentmonkey Scripts
// ==/UserScript==

// Function to remove min-height and disable auto-scroll
function fixElement(element) {
  element.style.minHeight = 'auto'; // Remove forced min-height
  element.scrollIntoView = () => {}; // Disable auto-scroll
}

// Apply to existing elements
document.querySelectorAll('[data-testid^="conversation-turn-"]').forEach(fixElement);

// Observer for new dynamically added elements
const observer = new MutationObserver((mutations) => {
  mutations.forEach((mutation) => {
    mutation.addedNodes.forEach((node) => {
      if (node.nodeType === 1 && node.matches('[data-testid^="conversation-turn-"]')) {
        fixElement(node);
      }
    });
  });
});

observer.observe(document.body, { childList: true, subtree: true });

console.log("Removed min-height and disabled auto-scroll for all chat elements.");