2/14/2025, 4:19:59 PM
当前为
// ==UserScript==
// @license MIT
// @name ChatGPT No Auto-Scroll
// @namespace Violentmonkey Scripts
// @match https://chatgpt.com/*
// @grant none
// @version 1.1
// @author -
// @description 2/14/2025, 4:19:59 PM
// ==/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.");