A Firefox browser extension to save your ChatGPT conversations as clean, styled HTML files.
- Any operating system (macOS, Linux, Windows)
zipcommand-line utility (pre-installed on macOS/Linux, available via Git Bash on Windows)
# Clone the repository
git clone https://github.com/CorticalCode/gpt-chat-save.git
cd gpt-chat-save
# Build the .xpi package
./build.shOr manually:
zip -r gpt-chat-save.xpi manifest.json popup/ content/ lib/ icons/ -x "*.DS_Store"The lib/ folder contains minified versions of open-source libraries:
| Library | Version | Source | License |
|---|---|---|---|
| DOMPurify | 3.2.4 | https://github.com/cure53/DOMPurify | Apache-2.0 |
| highlight.js | 11.11.1 | https://github.com/highlightjs/highlight.js | BSD-3-Clause |
These libraries are included as-is from their official distributions. No modifications were made.
- One-click export - Export the current ChatGPT conversation to HTML
- Image export - DALL-E generations and uploaded images embedded as base64 (portable, no external dependencies)
- Theme support - Auto-detect theme or force light/dark mode
- Syntax highlighting - Code blocks are highlighted using highlight.js
- Privacy-focused - All processing happens locally, no data leaves your browser
- Clean output - Produces readable, well-styled HTML files
(Add link when published)
- Clone this repository
- Open Firefox and navigate to
about:debugging - Click "This Firefox" → "Load Temporary Add-on"
- Select the
manifest.jsonfile from this repo
- Navigate to a ChatGPT conversation at chatgpt.com
- Click the extension icon in your toolbar
- Select a theme (or leave on Auto)
- Choose image handling (Include or Don't include)
- Click "Export to HTML"
- The HTML file will download automatically
This extension is designed with security in mind:
- Minimal permissions - Only requests
activeTabandstorage - Domain restricted - Only runs on
chatgpt.com - No network requests - All data stays local
- Content sanitization - Uses DOMPurify to sanitize all exported content
- Strict allowlist - Only safe HTML tags and no dangerous attributes are preserved
# Clone the repo
git clone https://github.com/CorticalCode/gpt-chat-save.git
cd gpt-chat-save
# Install Node.js via mise (optional, for running tests)
mise install
# Install dependencies (optional, for development)
npm install
# Package for distribution
zip -r gpt-chat-save.xpi manifest.json popup/ content/ lib/ icons/gpt-chat-save/
├── manifest.json # Extension manifest
├── popup/
│ ├── popup.html # Popup UI
│ ├── popup.css # Popup styles
│ └── popup.js # Popup logic
├── content/
│ ├── content.js # Content script (runs on chatgpt.com)
│ ├── images.js # Image processing (resize, base64, CORS fallback)
│ └── utils.js # Pure utility functions
├── lib/
│ ├── purify.min.js # DOMPurify for HTML sanitization
│ └── highlight.min.js # Syntax highlighting
├── tests/ # Unit tests (vitest)
└── icons/
└── icon.png # Extension icon
- DOMPurify - XSS sanitizer (MIT License)
- highlight.js - Syntax highlighting (BSD-3-Clause)
Contributions are welcome! Please feel free to submit a Pull Request.
This project builds on the excellent work of others:
- Enes Saltik - Created the original ChatGPT Export extension (v5.0.0) that made this possible. Thank you for the solid foundation and for releasing it under an open license.
- DOMPurify - HTML sanitization
- highlight.js - Syntax highlighting
This project is licensed under the Mozilla Public License 2.0.
See LICENSE for details.
See CHANGELOG.md for version history.