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

Greasy fork 爱吃馍镜像

Greasy Fork is available in English.

📂 缓存分发状态(共享加速已生效)
🕒 页面同步时间:2026/01/10 22:29:54
🔄 下次更新时间:2026/01/10 23:29:54
手动刷新缓存

ChatGPT | Table of Contents / TOC

Floating Table of Contents sidebar for ChatGPT conversations. Uses backend API for 100% accuracy (no lazy-loading gaps). Draggable toggle button, expandable message headers, click-to-navigate, persistent state.

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!)

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

公众号二维码

扫码关注【爱吃馍】

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

Penulis
piknockyou
Pemasangan harian
1
Total pemasangan
19
Nilai
0 0 0
Versi
3.3
Dibuat
01 Desember 2025
Diperbarui
31 Desember 2025
Size
27,4 KB
Lisensi
AGPL-3.0
Berlaku untuk

See screenshots at the bottom

ChatGPT | TOC (Table of Contents)

Adds a floating Table of Contents sidebar for navigating long ChatGPT conversations. Built on the backend API for 100% accuracy—no lazy-loading gaps.

Why You Need This

Long ChatGPT conversations become difficult to navigate:

  • Lost context: Hard to find that one message from 50 turns ago.
  • No overview: ChatGPT provides no way to see conversation structure at a glance.
  • DOM limitations: Other TOC scripts miss messages due to ChatGPT's lazy-loading/virtualization.

This script fetches the full conversation tree directly from ChatGPT's internal API, ensuring every message appears in the TOC.

Key Features

  • Complete Accuracy: Uses backend-api instead of DOM scraping—no missing messages from virtualization.
  • Expandable Headers: Messages with markdown headers (# H1, ## H2, etc.) or bold text (**Header**) show nested sub-navigation.
  • Distinct Icons: User messages and AI responses have different icons for quick visual scanning.
  • Draggable Toggle Button: Right-drag to reposition the toggle button anywhere on screen (position persists across sessions).
  • Smart Sidebar Positioning: Sidebar positions itself relative to the button, always staying within viewport bounds.
  • Click-to-Navigate: Click any TOC entry to scroll directly to that message with a subtle highlight flash.
  • Header Deep-Links: Expand a message's headers and click to jump directly to that specific section.
  • Persistent State: Open/closed state and button position saved via GM storage.
  • Auto-Refresh: Automatically updates when new messages are added or you switch conversations.

How to Use

Action Result
Left-click toggle button Open/close the TOC sidebar
Right-drag toggle button Move button anywhere (only when TOC is closed)
Click TOC entry Scroll to that message
Click arrow on entry Expand/collapse sub-headers
Click sub-header Scroll directly to that heading within the message

Architecture Difference

Unlike DOM-scraping approaches, this script:

  1. Fetches the full conversation from /backend-api/conversation/{uuid}
  2. Walks the message tree from current_node back to root
  3. Extracts headers from raw message text

This bypasses ChatGPT's virtualization entirely—messages that aren't rendered in the DOM still appear in the TOC.

Installation

  1. Install Violentmonkey, Tampermonkey, or Greasemonkey.
  2. Install this script.
  3. Visit chatgpt.com.

Works immediately. A toggle button (☰) appears in the top-right corner.