Skip to content

nxank4/dechatgpt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dechatgpt

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.

Why

ChatGPT's UI gets heavy in two predictable ways:

  • The sidebar #history list 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.

Install

  1. chrome://extensions
  2. Toggle Developer mode on (top right).
  3. Click Load unpacked, point it at this folder.
  4. The icon appears in the toolbar. Open a ChatGPT tab and click it for the feature toggles.

What the toggles do

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.

Files

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.

Privacy

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.

About

Lag free GPT extension

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors