ChatGPT Table of Contents Extension
A Chrome extension that automatically generates and displays a table of contents for ChatGPT conversations in a convenient right sidebar.
Features
- Automatic TOC Generation: Automatically detects headings (H1-H6) in ChatGPT responses
- Smart Navigation: Click any TOC item to jump directly to that section
- Real-time Updates: TOC updates automatically as new content is generated
- Visual Feedback: Highlights the target section when navigating
- Operation Friendly: Allow users to collapse sections in TOC
Installation
Method 1: Load as Unpacked Extension (Recommended for Development)
- Download or Clone this repository to your local machine
- Open Chrome and navigate to
chrome://extensions/
- Enable Developer Mode by toggling the switch in the top-right corner
- Click “Load unpacked” and select the folder containing this extension
- Navigate to ChatGPT at
https://chat.openai.com/
- Look for the “📋 TOC” button in the top-right corner of the page
Method 2: Install from Chrome Web Store (When Available)
- Navigate to Chrome Web Store
- Install the Extension by clicking “Add to Chrome” button
- Navigate to ChatGPT at
https://chat.openai.com/
- Look for the “📋 TOC” button in the top-right corner of the page
Usage
- Open ChatGPT and start a conversation
- Wait for the response to be generated
- Click the “📋 TOC” button in the top-right corner to open the sidebar
- Browse the table of contents - headings are automatically detected and organized
- Click any TOC item to jump to that section in the conversation
- Close the sidebar by clicking the “×” button or the toggle button again
How It Works
The extension:
- Monitors the page for new content using MutationObserver
- Scans for headings in ChatGPT assistant responses using multiple selectors
- Filters content to only include headings from assistant messages
- Organizes headings by their hierarchy (H1-H6) with proper indentation
- Provides navigation with smooth scrolling and visual highlighting
Contributing
Contributions are welcome! Please feel free to submit issues and pull requests.
License
This project is open source and available under the MIT License.
Support
If you encounter any issues or have questions:
- Open an issue on GitHub
- Check the browser console for error messages