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.

(У мене вже є менеджер скриптів, дайте мені встановити його!)

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

Автор
piknockyou
Щоденних встановлень
0
Всього встановлень
31
Рейтинги
0 0 0
Версія
3.3
Створено
01.12.2025
Оновлено
31.12.2025
Size
27,4 кБ
Ліцензія
AGPL-3.0
Відноситься до

See screenshots at the bottom

If you'd like to support me: https://ko-fi.com/piknockyou :-)

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.