Greasy Fork is available in English.

ChatGPT Auto Scroll to Bottom

Automatically keeps ChatGPT page scrolled to the bottom

Verze ze dne 08. 09. 2025. Zobrazit nejnovější verzi.

Autor
马牛逼(Felix)
Hodnocení
0 0 0
Verze
1.0
Vytvořeno
08. 09. 2025
Aktualizováno
08. 09. 2025
Size
794 B
Licence
GPL-v3
Spustit na

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.