โก A high-performance Chrome extension that virtualizes long ChatGPT conversations for blazing-fast performance
ChatGPT Virtualizer is a Chrome Manifest V3 extension that virtualizes long ChatGPT conversations to maintain optimal browser performance. It intelligently manages DOM elements by mounting only visible conversation turns and replacing others with lightweight placeholders, reducing memory usage by up to 90% in long threads.
Key Benefits:
- Eliminates browser slowdown on conversations with 50+ exchanges
- Maintains full conversation context and accessibility
- Zero data collection with complete offline functionality
- Seamless integration with ChatGPT's native interface
Production Ready: Thoroughly tested with strict TypeScript, comprehensive error handling, and professional architecture.
- โก Intelligent DOM Management โ Dynamically mounts/unmounts conversation turns based on visibility and user preferences
- ๐ Smart Pinning System โ Pin important turns to prevent automatic collapse
- ๐ฏ Tail Policy โ Automatically keeps the last N turns expanded for optimal UX
- ๐งญ Bulk Operations โ Expand all, collapse above viewport, or collapse before specific turns
- ๐๏ธ Per-Tab Control โ Enable/disable virtualization on individual ChatGPT tabs
- ๐จ Professional Design โ Clean, accessible UI with proper ARIA support and focus management
- โจ๏ธ Keyboard Shortcuts โ Customizable hotkeys for common actions
- โ Contextual Help โ Built-in help dialog with usage instructions
- ๐ก๏ธ Privacy-First โ Zero analytics, no network requests, complete offline operation
- โฟ Accessibility โ Full keyboard navigation, screen reader support, motion preferences
- ๐ง Developer Tools โ Debug mode and
window.__cgptVirtAPI for power users - ๐ Performance Metrics โ Real-time stats showing visible/total/pinned turn counts
Prerequisites:
- Chrome 120+ (Manifest V3 support)
- Node.js โฅ 18.17
- npm (included with Node.js)
Setup Instructions:
-
Clone & build
git clone https://github.com/mahid797/chatgpt-virtualizer.git cd chatgpt-virtualizer npm install npm run build -
Install Extension
- Navigate to
chrome://extensions - Enable Developer mode (toggle in top-right)
- Click Load unpacked and select the
dist/folder
- Navigate to
-
Activate Extension
- Visit chat.openai.com or chatgpt.com
- Click the extension icon in Chrome toolbar
- Toggle "Enable on this tab"
Coming Soon
Access the control panel by clicking the extension icon in Chromeโs toolbar.
Controls
- Enable on this tab โ toggles virtualization for the current ChatGPT tab.
- Keep last N turns โ sets how many recent turns remain expanded (enforced when you click Apply).
- Help โ opens a contextual help dialog with shortcuts and feature explanations.
- Stats โ shows โCurrently visible / total โข Pinnedโ when enabled on an active tab.
Bulk actions
- Expand all turns โ makes all conversation turns visible (respects existing pins).
- Collapse above viewport โ collapses turns that are above the first visible turn.
- Collapse aboveโฆ โ collapses everything before a specific turn:
- #N format: use a 1-based turn index (e.g.,
#15for turn 15) - data-turn-id format: use ChatGPTโs internal turn identifier
- #N format: use a 1-based turn index (e.g.,
Tip: All actions affect only the currently active ChatGPT tab.
Each turn has a small circular chevron button pinned to the right.
| Action | Behavior |
|---|---|
| Click | Toggle expand/collapse for that turn |
| Shift+Click | Pin the turn to keep it expanded |
| Alt+Click | Clear the pin |
| Shortcut | Action |
|---|---|
Ctrl/Cmd + Shift + 9 |
Expand all turns |
Ctrl/Cmd + Shift + 8 |
Collapse above viewport |
Customize at chrome://extensions/shortcuts.
ChatGPT Virtualizer employs sophisticated DOM virtualization techniques to maintain optimal performance in long conversations:
The extension operates through three main components:
- State Manager โ Tracks each conversation turn's state (expanded/collapsed), user pins, and auto-intent preferences
- Virtualizer Engine โ Monitors DOM changes and applies tail policies to determine which turns should remain mounted
- Bulk Operations โ Provides high-level actions for managing multiple turns simultaneously
Turn Detection: The content script identifies ChatGPT turns using article[data-turn-id] selectors and creates a lightweight state management layer.
Smart Replacement: When a turn is collapsed:
- Original DOM content is preserved in memory
- Turn is replaced with a minimal placeholder (3-5 DOM nodes vs. 100+ original nodes)
- Placeholder displays turn metadata (role, index) and maintains interaction capabilities
Tail Policy: Recent turns stay expanded based on your "Keep last N" setting, while older turns collapse automatically unless pinned.
| Scenario | Before Virtualization | After Virtualization | Improvement |
|---|---|---|---|
| 50-turn conversation | ~5000 DOM nodes | ~500 DOM nodes | 90% reduction |
| 100-turn conversation | ~10000 DOM nodes | ~800 DOM nodes | 92% reduction |
| Memory usage | High (slowdown) | Minimal (smooth) | Significant |
The extension maintains conversation context and accessibility while dramatically reducing browser resource consumption.
Access settings through the extension popup (click the toolbar icon):
| Setting | Description |
|---|---|
| Enable on this tab | Turn virtualization on/off for the current ChatGPT conversation |
| Keep last N turns | How many recent exchanges always stay visible (default: 3) |
Settings are saved automatically. Per-tab enablement is session-scoped and independent for each tab; Keep last N is a global setting.
- ARIA states โ Chevron button uses
aria-expandedto reflect turn state. - Focus management โ Keyboard navigation with visible focus rings across buttons, fields, and the toggle.
- Motion respect โ Honors
prefers-reduced-motionfor animations. - Screen readers โ Proper labeling and state announcements.
storageโ For local settings persistencetabsโ To locate and message the active ChatGPT tab- Host permissions:
https://chat.openai.com/*,https://chatgpt.com/*
- โ No analytics or telemetry
- โ No remote calls or data collection
- โ All processing happens locally in your browser
- โ Open source for full transparency
- Chrome: Version 120 or newer
- Chromium-based browsers: Edge, Brave, Opera (version 120+)
- Websites: Works on both
chat.openai.comandchatgpt.com
Extension installed but no chevron buttons visible
- Ensure youโre on
chat.openai.comorchatgpt.com. - Verify the extension is enabled on this tab via the popup.
- Refresh the page after enabling for the first time.
- Check that you have at least one conversation turn visible.
Bulk actions donโt work
- Confirm virtualization is enabled on the current tab.
- Ensure youโre on an active ChatGPT conversation page.
- Check the browser console for errors (F12 โ Console).
Collapsed turns donโt expand when clicked
- Click the circular chevron button (not the placeholder text).
- Try Shift+Click to pin first, then click normally.
- Verify the page hasnโt navigated away from ChatGPT.
Settings changes not taking effect
- โKeep last Nโ is enforced when you click Apply.
- If issues persist, try disabling and re-enabling the extension.
Performance issues persist despite virtualization
- Check if debug mode is accidentally enabled (adds overhead).
- Verify that most older turns are collapsed.
- Lower the Keep recent value for very long conversations.
Console shows runtime.lastError warnings
- MV3 service workers can sleep; reopen the ChatGPT tab and try again. The popup handles this gracefully.
Changes not picked up after rebuild
- Click Reload on the extension in
chrome://extensions/after building.
When debug mode is enabled:
- Console logging shows virtualization decisions.
- Visual indicators highlight placeholder boundaries.
- The
window.__cgptVirtAPI becomes available for inspection.
- Open the built-in Help dialog in the popup.
- Review this troubleshooting section.
- Inspect the console for errors.
- For persistent issues, see CONTRIBUTING.md for bug-reporting guidelines.
We welcome contributions from developers! This is an open-source project built with TypeScript and modern Chrome extension standards.
For Contributors: See CONTRIBUTING.md for complete development setup, architecture details, and coding guidelines.
Privacy Commitment: All contributions must maintain our zero-analytics, offline-first approach. No telemetry or network requests allowed.
ChatGPT Virtualizer is licensed under the MIT License โ see the LICENSE file for details.
Copyright (c) 2025 ChatGPT Virtualizer
Built with modern web standards and Chrome extension best practices. No third-party dependencies in production build.
โญ Star this repo if it helps you keep your ChatGPT conversations snappy! โญ