Add download buttons to code blocks across ChatGPT, Z.Ai, Gemini, LMArena, Kimi, Le Chat, Meta AI, Copilot, Grok, and LongCat. Save snippets as ready-to-use files and organize multiple downloads with an advanced management menu.
- ChatGPT (chatgpt.com)
- Z.AI (chat.z.ai)
- Google Gemini (gemini.google.com)
- LMArena (lmarena.ai)
- Kimi (www.kimi.com)
- Le Chat / Mistral (chat.mistral.ai)
- Meta AI (www.meta.ai)
- Microsoft Copilot (copilot.microsoft.com)
- Grok (grok.com)
- LongCat (longcat.chat)
- Open Chrome and navigate to
chrome://extensions/ - Enable Developer mode (toggle in top-right corner)
- Click "Load unpacked"
- Select the
codedown-extensionfolder - The CodeDown icon should appear in your extensions toolbar
- Click the puzzle piece icon in Chrome's toolbar
- Find "CodeDown" and click the pin icon
- Navigate to any supported AI chat site
- Code blocks will automatically have a Download button added
- Click the button to download that specific code snippet
Open the manager using any of these methods:
- Keyboard shortcut:
Alt+Shift+S - Extension popup: Click the CodeDown icon in the toolbar
- Right-click menu: Right-click on the page and select "Open CodeDown Manager"
The manager lets you:
- View all code blocks on the current page
- Select/deselect individual blocks (Shift+click for range selection)
- Download selected blocks as a ZIP file
- ✅ Extension loads without errors in
chrome://extensions/ - ✅ Icon appears in toolbar
- ✅ Visit chatgpt.com and generate some code
- ✅ Download buttons appear on code blocks
- ✅ Press
Alt+Shift+Sto open the manager - ✅ Click a download button - file downloads with correct extension
Content Script Logs:
- Open DevTools on the AI chat page (F12)
- Go to Console tab
- Logs prefixed with
[CodeDown](only visible if DEBUG=true in content.js)
Service Worker Logs:
- Go to
chrome://extensions/ - Find CodeDown and click "Service worker" link
- DevTools opens for the background script
- Logs prefixed with
[CodeDown BG]
codedown-extension/
├── manifest.json # Extension manifest (MV3)
├── background.js # Service worker (context menu, shortcuts)
├── content.js # Main functionality (injected into pages)
├── styles.css # Injected CSS styles
├── popup.html # Extension popup UI
├── popup.js # Popup logic
├── lib/
│ └── jszip.min.js # JSZip library for ZIP creation
├── icons/
│ ├── icon16.png # 16x16 icon
│ ├── icon48.png # 48x48 icon
│ └── icon128.png # 128x128 icon
└── README.md # This file
- storage: Reserved for future settings (not currently used)
- contextMenus: Right-click "Open CodeDown Manager" option
- host_permissions: Required to inject content scripts on supported AI chat sites
| Shortcut | Action |
|---|---|
Alt+Shift+S |
Open/close CodeDown Manager |
You can customize this in chrome://extensions/shortcuts
- GM_registerMenuCommand → Context menu + popup + keyboard shortcut
- ScriptNotifier → Removed (update notifications not needed for extensions)
- GM_addStyle → CSS file injected via manifest
- JSZip → Vendored locally in
lib/folder
Download buttons don't appear:
- Refresh the page
- Check that the extension is enabled
- Verify you're on a supported site
Manager doesn't open:
- Try the keyboard shortcut (
Alt+Shift+S) - Check for errors in the console
- Reload the extension
ZIP download fails:
- Check browser console for errors
- Ensure JSZip library loaded correctly
- Original userscript by OHAS
- Converted to Chrome Extension (MV3)
CC-BY-NC-ND-4.0