ChatGPT Auto Scroll to Bottom

Automatically keeps ChatGPT page scrolled to the bottom

作者
马牛逼(Felix)
日安装量
0
总安装量
0
评分
0 0 0
版本
1.0
创建于
2025-09-08
更新于
2025-09-08
大小
794 字节
许可证
GPL-v3
适用于

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.

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址