Skip to content

TomSchmidtDev/browser-ai-chat-exporter

Repository files navigation

AI Chat Exporter

Deutsche Version: README.de.md

Browser extension for exporting conversations from Claude, ChatGPT, Gemini, and Microsoft Copilot β€” as complete, standalone files that work without an account, without the platform, and without an internet connection.

Version: 1.8.2 Β· Browser: Chrome, Edge


Supported Platforms

Platform URL Method Notes
πŸ”Ά Claude claude.ai API + DOM fallback Full feature set incl. Artifacts, Thinking, Tool Calls
🟒 ChatGPT chatgpt.com DOM scraping Text, code, tables β€” no interactive widgets
πŸ”΅ Gemini gemini.google.com DOM scraping Text, code, tables
πŸͺŸ Microsoft Copilot copilot.microsoft.com DOM scraping Text, code, tables
πŸͺŸ Microsoft Copilot M365 m365.cloud.microsoft/chat DOM scraping Text, code, tables

Export dialog

Note: Feature coverage varies by platform. Claude uses the official API and delivers structured data including all block types. For ChatGPT, Gemini, and Copilot, content is read from the rendered DOM β€” meaning text and code are reliably exported, while platform-specific content like Artifacts or interactive elements is not available.


Why this extension?

No vendor lock-in when sharing

Shared chats are platform-bound and exclude many recipients:

  • ChatGPT Enterprise β€” a shared chat is only accessible to recipients in the same company account.
  • Claude β€” shared chats do not show Artifacts and visual content if the recipient has no Claude account.

The export works for everyone β€” as a simple HTML, ZIP, Markdown, or PDF file, without an account, without login, independent of the platform.

Long-term archive

Chats containing important decisions, code reviews, analyses, or research are preserved as standalone files β€” regardless of whether the account still exists, the subscription expires, or the platform shuts down.

Complete content

Not just text: Artifacts (interactive React apps, diagrams, SVGs), generated files, code blocks with syntax highlighting, and tables are fully exported and remain functional in the export.

Four formats for every purpose

Format Ideal for
HTML Sharing with colleagues, embedding in documentation, fully offline
ZIP All files and Artifacts individually accessible, ready to use
Markdown Obsidian, Notion, Confluence, Git repositories
PDF Formal documentation, meetings, archiving

Installation

Chrome / Edge

  1. Download the ZIP and unpack it
  2. Open chrome://extensions (or edge://extensions)
  3. Enable Developer mode (toggle in the top right)
  4. Click Load unpacked
  5. Select the unpacked ai-chat-exporter folder
  6. The extension icon appears in the toolbar

Important: The folder from which the extension was loaded must not be moved or deleted. Chrome loads the extension files directly from this directory β€” if it is removed, the extension will stop working and must be reinstalled.

After an update: Click the reload icon on the extensions page so that new context menu entries and permissions take effect.


Usage

Option 1 β€” Toolbar icon

  1. Open a chat on a supported platform
  2. Click the extension icon in the toolbar
  3. Choose a format: HTML, ZIP, Markdown, or PDF
  4. Click Export Chat β€” or Preview & Select for selective export

Option 2 β€” Right-click context menu

Right-click on the page β†’ "Chat exportieren":

  • Export as HTML
  • Export as Markdown
  • Export as ZIP
  • Export as PDF
  • Preview & Select…

The export starts immediately β€” no popup needed.

Option 3 β€” Preview & Select

Preview & Select

Opens a dedicated tab with the full conversation view:

  • Checkboxes per message and per block (text, code, artifact, image, thinking, tool output, etc.)
  • Everything selected by default
  • Quick selection buttons:
    • Select All / Deselect All β€” all messages and blocks
    • Deselect All Prompts β€” deselect only your own questions
    • Deselect Tool Output β€” deselect thinking, tool calls, web searches, etc.
  • Choose format and click Export Selected

Supported content by platform

Content type Claude ChatGPT Gemini Copilot
Text with formatting βœ… βœ… βœ… βœ…
Code blocks βœ… βœ… βœ… βœ…
Tables βœ… βœ… βœ… βœ…
Artifacts (React, HTML, SVG) βœ… interactive β€” β€” β€”
Visualizer widgets βœ… β€” β€” β€”
Thinking blocks βœ… β€” β€” β€”
Tool calls / web search βœ… optional β€” β€” β€”
Embedded images βœ… β€” β€” β€”
Generated files βœ… β€” β€” β€”
Timestamps & metadata βœ… β€” β€” β€”

The limitations for ChatGPT, Gemini, and Copilot are technical: these platforms do not provide an accessible API for retrieving chat histories, so content is read from the rendered DOM.


Privacy

All processing happens locally in the browser. No data is sent to the developer, no analytics, no tracking.

ChatGPT, Gemini, Microsoft Copilot

These platforms are scraped from the already-rendered DOM β€” no network requests are made by the extension. The content is read from what the browser has already loaded and is processed entirely in memory.

Claude β€” what is sent during export

Claude uses its official API to deliver complete and structured export data (including Artifacts, Thinking blocks, and generated files). This requires the extension to make authenticated requests to claude.ai on your behalf.

What is sent β€” and where:

All requests go exclusively to claude.ai. No data leaves your browser to any other destination.

Request Endpoint Purpose
GET /api/organizations/{orgId}/chat_conversations/{id}?tree=True&rendering_mode=messages&render_all_tools=true Fetch the full conversation data
GET /api/bootstrap or /api/organizations Determine the organisation ID (only if not already known from an intercepted page request)
GET /api/share/{id} Fetch shared conversations (no authentication required)
GET Image URL on claude.ai Fetch embedded images as Base64 for self-contained exports (only when "Embed images" option is enabled)

What is sent with each request:

The requests use the browser's existing session cookies for claude.ai β€” the same cookies that are sent with every normal page interaction. No additional credentials are read, stored, or forwarded by the extension.

What happens to the data:

claude.ai API  β†’  browser memory  β†’  local export file (HTML / ZIP / MD / PDF)

The conversation data is fetched into browser memory, converted into the export format, and written to a local file via the browser's download dialog. It is never uploaded, forwarded, or cached outside the current browser session. chrome.storage.session is used only to pass the data to the Preview & Select tab β€” it is automatically cleared when the browser is closed.

What the extension does not do:

  • Does not read, store, or transmit your Claude API key or password
  • Does not modify any conversations or send any write requests
  • Does not collect usage data or statistics
  • Does not load any external scripts or resources into the extension itself (vendor libraries are bundled locally and only embedded inside the sandboxed iframes of exported artifact files)

The extension activates only on the four supported domains and is completely inactive on all other sites.


Architecture

ai-chat-exporter/
β”œβ”€β”€ manifest.json              v1.8.2, permissions: activeTab, storage,
β”‚                              downloads, contextMenus
β”œβ”€β”€ background.js              Downloads, context menu, tab opening for PDF
β”œβ”€β”€ popup.html / popup.js      UI, platform detection, export orchestration
β”œβ”€β”€ popup.css
β”œβ”€β”€ options.html / options.js  Settings page (language selection)
β”œβ”€β”€ preview.html / preview.js  Preview & Select (chrome.storage.session)
β”‚                              Supports ?autoexport=<format> for direct export
β”‚                              from the context menu
β”‚
β”œβ”€β”€ platforms/
β”‚   β”œβ”€β”€ claude/
β”‚   β”‚   β”œβ”€β”€ injector.js        Page context: fetch patch, org ID, auth API
β”‚   β”‚   └── content.js         Bridge + API normalisation + DOM fallback
β”‚   β”œβ”€β”€ chatgpt/
β”‚   β”‚   β”œβ”€β”€ injector.js        Page context: fetch patch, conversation ID capture
β”‚   β”‚   └── content.js         DOM scraping (CodeMirror, tables as HTML sentinel)
β”‚   β”œβ”€β”€ gemini/
β”‚   β”‚   └── content.js         DOM scraping (Angular: user-query, model-response)
β”‚   └── copilot/
β”‚       └── content.js         DOM scraping (Fluent UI: fai-UserMessage,
β”‚                              fai-CopilotMessage, scriptor-component-code-block)
β”‚
β”œβ”€β”€ scripts/
β”‚   └── bundle-vendors.js      Node.js generator: reads shared/vendor/* and
β”‚                              writes shared/vendor.js (run after updating vendors)
β”‚
└── shared/
    β”œβ”€β”€ i18n.js                i18n runtime (en/de), t(), initI18n(), applyI18n()
    β”œβ”€β”€ utils.js               escHtml, escAttr, escSrcdoc, safeUrl,
    β”‚                          markdownToHtml, sanitizeFilename, formatFileSize
    β”œβ”€β”€ vendor.js              AUTO-GENERATED β€” bundled vendor libs as JS string
    β”‚                          constants (VENDOR_REACT, VENDOR_MERMAID, etc.)
    β”œβ”€β”€ vendor/                Raw vendor files (source of truth for versions):
    β”‚   β”œβ”€β”€ react.production.min.js       React v18.2.0
    β”‚   β”œβ”€β”€ react-dom.production.min.js   ReactDOM v18.2.0
    β”‚   β”œβ”€β”€ babel.min.js                  Babel Standalone v7.23.9
    β”‚   β”œβ”€β”€ tailwind.min.css              Tailwind CSS v2.2.19
    β”‚   β”œβ”€β”€ Recharts.min.js               Recharts v2.12.7
    β”‚   β”œβ”€β”€ mermaid.min.js                Mermaid v10.6.1
    β”‚   β”œβ”€β”€ highlight.min.js              highlight.js v11.9.0
    β”‚   └── highlight-dark.min.css        highlight.js dark theme
    β”œβ”€β”€ widget-css.js          CSS variables + artifact/visualizer iframe builder
    β”œβ”€β”€ html-template.js       Export HTML template with copy button, dark mode,
    β”‚                          syntax highlighting (hljs), Mermaid placeholder
    └── exporters/
        β”œβ”€β”€ html.js            HTML & PDF exporter
        β”œβ”€β”€ markdown.js        Markdown exporter
        └── zip.js             ZIP exporter (2-pass: artifacts, files, images)

Adding a new platform

  1. Create platforms/<name>/content.js
  2. Add to manifest.json under content_scripts and host_permissions
  3. Add to background.js β†’ SUPPORTED_URLS
  4. Add to popup.js β†’ detectPlatform() and platformLabel()
  5. Add badge mapping in shared/exporters/html.js

License

Business Source License 1.1 β€” free for personal, non-commercial, and internal business use. Converts to Apache 2.0 on 2031-04-04. See LICENSE.md for details.

About

A browser extension to export ai chats on different plattforms like claude, chatgpt, gemini, copilot in different formats.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors