Chrome extension that cuts paint/layout cost on chatgpt.com when the sidebar
fills with chats or a thread grows long. No data leaves your machine.
ChatGPT's UI gets heavy in two predictable ways:
- The sidebar
#historylist keeps every chat row in the DOM with sprite icons and hover state. - Each
<section data-testid="conversation-turn-*">is a full markdown subtree, and code blocks are live CodeMirror editors — expensive to keep around off-screen.
This extension applies the same content-visibility: auto +
contain-intrinsic-size: auto Xpx recipe Claude.ai and ChatGPT's own React
code use, plus a JS-managed deferrer for CodeMirror (which carries listeners
that paint-skipping alone can't silence), plus a paste interceptor for the
ProseMirror composer.
chrome://extensions- Toggle Developer mode on (top right).
- Click Load unpacked, point it at this folder.
- The icon appears in the toolbar. Open a ChatGPT tab and click it for the feature toggles.
| Toggle | What it does |
|---|---|
| Virtualize sidebar list | CSS-only. Browser skips paint for off-screen #history rows. |
| Virtualize conversation turns | CSS-only. content-visibility: auto on each <section> with a 32 px geometric activation buffer. |
| Defer code blocks | JS. Far off-screen .cm-editor blocks are detached to a WeakMap, replaced by a <pre> stub at the same height, restored on scroll-in. |
| Fast paste & type | JS + CSS. Intercepts paste on #prompt-textarea and inserts plain text (skips ProseMirror's rich-paste reparse). Adds contain: layout style to the editor. |
| Kill animations | CSS. Strips motion-safe:* transitions and lottie loops. Composer animations preserved. |
| Code-block buffer | px past the viewport at which .cm-editor blocks are detached/restored. Default 4000. |
manifest.json MV3 manifest, content_scripts → chatgpt.com + chat.openai.com
content.css CSS-only optimizations gated by html.dcgpt-* class flags
content.js CodeBlockDeferrer + ComposerOptimizer + storage→class wiring
popup.html/js Toggle UI backed by chrome.storage.sync
icons/ Toolbar icons
No build step, no npm, no telemetry. Reload the extension after editing files during development.
Only storage permission. No network requests, no host_permissions beyond the
two content_scripts matches. Settings are stored in chrome.storage.sync so
they follow your Chrome profile.