🎉 欢迎访问GreasyFork.Org 镜像站!本镜像站由公众号【爱吃馍】搭建,用于分享脚本。联系邮箱📮

Greasy fork 爱吃馍镜像

ChatGPT | TOC

Backend navigation with dynamic resizing, distinct icons, and bold-header support.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

🚀 安装遇到问题?关注公众号获取帮助

公众号二维码

扫码关注【爱吃馍】

回复【脚本】获取最新教程和防失联地址

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

🚀 安装遇到问题?关注公众号获取帮助

公众号二维码

扫码关注【爱吃馍】

回复【脚本】获取最新教程和防失联地址

Author
piknockyou
Daily installs
1
Total installs
11
Ratings
0 0 0
Version
2.6
Created
2025-12-01
Updated
2025-12-01
Size
16.7 KB
License
MIT
Applies to

ChatGPT Backend TOC

A lightweight Userscript that adds a collapsible Table of Contents sidebar to ChatGPT.

🚀 Why this script?

Most navigation extensions try to read the headers from the current webpage HTML. However, ChatGPT uses "lazy loading" (virtualization), meaning messages scroll off-screen are often removed from the code to save memory. This causes other extensions to "lose" parts of the conversation.

This script is different. It fetches the conversation data directly from ChatGPT's internal Backend API. This means:

  • It loads the entire conversation map instantly.
  • It never misses a header, even in extremely long chats.
  • It forces the browser to jump to the correct message ID, triggering the render on demand.

✨ Features

  • 100% Complete: Navigates the full history, not just what is currently visible.
  • Deep Navigation: Detects Markdown headers (#) and Bold Text as clickable sub-sections.
  • Smart Scrolling: Calculates the correct scroll position so text doesn't hide behind the top header bar.
  • Clean UI:
    • Resizable sidebar (drag the edge).
    • Distinct icons for User (Gray) vs. AI (Green).
    • Expand/Collapse arrows for nested content.
    • Long titles auto-expand when you widen the sidebar.

Credits

Heavily inspired by the Scroll Extension by Asker Kurtelli. This version was ported to a Userscript to utilize direct API fetching and reduce the need for a full browser extension.