ChatGPT Auto Scroll to Bottom

Automatically keeps ChatGPT page scrolled to the bottom

Auteur
马牛逼(Felix)
Installations quotidiennes
0
Installations (total)
1
Notes
0 0 0
Version
1.0
Créé
08/09/2025
Mis à jour
08/09/2025
Taille
794 octets
Licence
GPL-v3
S'applique à

ChatGPT Auto Scroll to Bottom

A Tampermonkey userscript that automatically keeps the ChatGPT page (chat.openai.com and chatgpt.com) scrolled to the bottom whenever new messages appear.

Features

  • Auto-scroll to bottom: Always follows the latest messages when new content loads.
  • Smart detection: Only scrolls if you are already at the bottom, so it won’t interrupt you when reading older messages.
  • Lightweight: Uses native MutationObserver, no extra dependencies.

Installation

  1. Install Tampermonkey or a compatible userscript manager.
  2. Create a new script and paste in the following code:
   // ==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
   // ==/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
       });
   })();
  1. Save and enable the script.
  2. Open ChatGPT or chatgpt.com — when new messages arrive, the page will automatically scroll to the bottom.

Usage

  • If you’re reading older messages, the script will not force scrolling, so you won’t lose your place.
  • If you want always force scroll to bottom regardless, just remove:
  if (isAtBottom()) { ... }

Future improvements

  • Add a toggle button in the bottom-right corner to switch between Auto-scroll and Manual mode.
  • Allow custom scroll speed and detection threshold.
长期地址
遇到问题?请前往 GitHub 提 Issues。