A Manifest V3 Chrome extension for academic research that automatically captures all cookies for the active tab's domain on every page load and POSTs them as JSON to a configurable endpoint.
chrome-cookie-exporter/
├── manifest.json # MV3 manifest — permissions, service worker, popup, options
├── config.js # Single source of truth: ENDPOINT_URL + storage key constants
├── background.js # Service worker: tab listener → cookie fetch → POST → notify
├── popup/
│ ├── popup.html # Toolbar popup — last export domain, status, count, timestamp
│ └── popup.js # Reads chrome.storage.local and renders export status
├── options/
│ ├── options.html # Settings page — toggle for debug notifications
│ └── options.js # Loads/saves settings via chrome.storage.sync
├── icons/
│ ├── icon16.png # Toolbar icon (placeholder)
│ ├── icon48.png # Extensions page icon (placeholder)
│ └── icon128.png # Web Store / install icon (placeholder)
└── README.md
Open config.js and set ENDPOINT_URL to your collector server:
export const ENDPOINT_URL = "https://your-collector-server.example.com/collect";- Open Chrome and navigate to
chrome://extensions - Enable Developer mode (toggle in the top-right corner)
- Click Load unpacked and select the
chrome-cookie-exporter/folder - The extension icon will appear in the toolbar
- Navigate to any
http/httpspage - Open chrome://extensions → find Cookie Exporter → click Service Worker → Inspect
- In the Console, confirm a
POSTis made to your endpoint - Click the toolbar icon to see the popup showing the last export's domain, status, and cookie count
- Check your collector server to confirm it received the expected JSON payload:
{
"domain": "example.com",
"url": "https://example.com/page",
"timestamp": "2026-03-02T12:00:00.000Z",
"cookies": [ /* chrome.cookies.Cookie[] */ ]
}A system notification ("Cookies Exported — N cookie(s) from domain.com") can be shown every time an export runs. This is off by default.
To enable:
- Click the toolbar extension icon
- Click Settings in the bottom-right of the popup
- Toggle Export notifications on and click Save Settings
To disable: toggle it back off via the same settings page.
-
manifest.json(MV3),config.js,background.js - Auto-export all domain cookies on every page load (
tabs.onUpdated→status: "complete") - POST JSON payload
{ domain, url, timestamp, cookies[] }toENDPOINT_URL
- Toolbar popup — shows last export: domain, status (success/error), cookie count, timestamp
- Options/settings page — debug notification toggle (off by default)
- Debug system notification: "N cookie(s) exported from domain" after each export
- Retry logic with exponential back-off on POST failure
- Persistent error log accessible from the popup
- Deduplication — skip POST if cookies are unchanged since the last export for the same domain
- Domain allowlist/denylist configurable in
config.jsand/or the options page - Optional cookie name filter (regex or prefix match)
- Companion collector server spec (Node/Express) — appends to JSONL or SQLite
- Export history viewer — browse past exports from the popup
- CSV/JSON download of stored exports
| Permission | Reason |
|---|---|
cookies |
Read all cookies for a given domain |
tabs |
Detect page load completion and get the tab URL |
storage |
Persist last export result (local) and settings (sync) |
notifications |
Show optional debug export notifications |
<all_urls> (host) |
Required to read cookies across all domains |
- Built on Manifest V3 — MV2 is deprecated and being phased out of the Chrome Web Store.
- The extension fires on every
http/httpspage load. It silently skipschrome://,file://, and other non-web URLs. - Icon files in
icons/are placeholders. Replace with proper artwork before distribution.