A Chrome MV3 extension that exports a full ChatGPT history to JSON in the shape of ChatGPT's own conversations.json, for the Amgreat Gemini migration tool. Everything runs in the user's browser against their own session. Batches of 25 per file, downloaded through the service worker because Chrome blocks multiple page-initiated downloads. Adaptive pacing with 429 backoff, Retry-After support, token refresh and localStorage resume.
75 lines
3.6 KiB
Markdown
75 lines
3.6 KiB
Markdown
# ChatGPT export extension (Amgreat)
|
|
|
|
A small Chrome extension that exports a user's **full** ChatGPT history to JSON
|
|
files — no paywall, no limits, nothing leaves the browser. Its output has the
|
|
same shape as ChatGPT's official `conversations.json`, so it drops straight into
|
|
the migration tool.
|
|
|
|
Current version: **1.4**, shown in the footer of the extension's own window, so
|
|
you can tell which build a machine actually has loaded.
|
|
|
|
## How it works
|
|
|
|
Runs as a content script on `chatgpt.com`, in the page's own origin, so it uses
|
|
the user's existing logged-in session. It calls ChatGPT's own internal API
|
|
(`/backend-api/conversations` to list, `/backend-api/conversation/{id}` to fetch
|
|
each in full), assembles them into a JSON array, and offers it as a download.
|
|
That is exactly what the paid extensions do — the paywall is artificial.
|
|
|
|
A green **"Export for Gemini"** button appears bottom-right on ChatGPT. Click it
|
|
and a window opens showing each step and a progress bar. Conversations download
|
|
in **batches of 25**, one file per batch, named
|
|
`chatgpt-export-<date>-partN.json`. Feed all of them to the migration tool at
|
|
once.
|
|
|
|
Two details worth knowing:
|
|
|
|
- **Downloads go through the service worker.** Chrome blocks a page from
|
|
starting more than one download, so `background.js` performs them via
|
|
`chrome.downloads`. The blob URL has to be created in the content script,
|
|
because service workers have no `URL.createObjectURL`.
|
|
- **The pace adapts.** It starts at 1.5s between conversations, speeds up while
|
|
requests succeed, and backs off 1.3x on every HTTP 429, honouring
|
|
`Retry-After` when ChatGPT sends one. After sustained throttling it takes a
|
|
five-minute rest rather than hammering. Progress is saved to `localStorage`,
|
|
so an interrupted run resumes at the right batch instead of starting over.
|
|
|
|
Free accounts throttle hard at roughly 33 conversations. Paid accounts run at
|
|
about 21 conversations a minute.
|
|
|
|
## Try it yourself (unpacked, 1 minute)
|
|
|
|
1. Chrome → `chrome://extensions` → toggle **Developer mode** (top right) on.
|
|
2. **Load unpacked** → pick this folder.
|
|
3. Open/refresh **chatgpt.com** → the green button is bottom-right → click it.
|
|
4. Leave the window open. Files land in Downloads as each batch completes.
|
|
|
|
## Rolling it out to 30 people
|
|
|
|
Don't ask non-savvy staff to enable developer mode. Two clean options, both
|
|
using tools you already have:
|
|
|
|
- **Force-install via Google Admin Console (recommended).** You manage Chrome
|
|
through Workspace already. Zip this folder, host it (or publish it *unlisted*
|
|
to the Chrome Web Store), then Admin Console → **Devices → Chrome → Apps &
|
|
extensions** → add it as **Force install** for the org. It appears for
|
|
everyone automatically, no clicks, no developer mode.
|
|
- **Unlisted Chrome Web Store item.** Publish once (one-time $5 dev fee), share
|
|
the private link; users click "Add to Chrome". Simpler than self-hosting, and
|
|
it auto-updates.
|
|
|
|
Either way the extension stays yours and free of limits.
|
|
|
|
## Notes / limits
|
|
|
|
- **Text only.** Conversations come across in full; image/file attachments do
|
|
not (same as the migration tool).
|
|
- **The user must be logged in to ChatGPT** in that browser; the window says so
|
|
if they are not. The session token refreshes automatically if it expires
|
|
part-way through a long run.
|
|
- A large history takes a while. It fetches one chat at a time on purpose, to
|
|
stay under ChatGPT's rate limits; half an hour is normal for a few hundred
|
|
conversations.
|
|
- If ChatGPT changes its internal API, the two endpoint paths in `content.js`
|
|
may need updating. They are the only ChatGPT-specific parts.
|