ChatGPT Auto Scroll to Bottom

Automatically keeps ChatGPT page scrolled to the bottom

// ==UserScript==
// @name         ChatGPT Auto Scroll to Bottom
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  Automatically keeps ChatGPT page scrolled to the bottom
// @match        https://chat.openai.com/*
// @match        https://chatgpt.com/*
// @grant        none
// @license      GPL-v3
// ==/UserScript==

(function() {
    'use strict';

    function isAtBottom() {
        return Math.abs(window.innerHeight + window.scrollY - document.body.scrollHeight) < 5;
    }

    const observer = new MutationObserver(() => {
        if (isAtBottom()) {
            window.scrollTo({ top: document.body.scrollHeight, behavior: 'smooth' });
        }
    });

    observer.observe(document.body, {
        childList: true,
        subtree: true
    });
})();
长期地址
遇到问题?请前往 GitHub 提 Issues。