A Chrome extension to clean browsing history, cookies, and site data for specific domains. Set up automatic cleanup rules, whitelist trusted sites, and take control of your browsing privacy.
- Search any domain to see its history entries and cookies count
- Clean history, cookies, localStorage, sessionStorage, IndexedDB, and cache per domain
- Time range filter: last hour, today, last 7 days, last 30 days, or all time
- Smart domain normalization: automatically strips
http://,www., ports, and paths from input
- Paginated search ensures every history entry is found, even for high-traffic sites like YouTube
- Searches across all subdomain variants:
domain.com,www.domain.com,m.domain.com - Deduplicates results to prevent double-counting
- Batch deletion in chunks of 500 for reliable large-scale cleanup
- Removes entries from Chrome's address bar autocomplete (omnibox)
- Finds cookies across 6 domain variants:
domain.com,.domain.com,www.domain.com,.www.domain.com,m.domain.com,.m.domain.com - Handles dot-prefixed cookie domains correctly (e.g.
.youtube.com) - Batch deletion in chunks of 200 with per-cookie error handling
- Supports both secure (HTTPS) and non-secure (HTTP) cookie URLs
- Clears localStorage, sessionStorage, IndexedDB, cache, cacheStorage, and service workers
- Targets 5 origin variants:
https://,http://,www.,m.combinations - Injects into open tabs matching the domain for live localStorage/sessionStorage clearing
- Create rules for specific domains with custom triggers:
- Manual - clean on demand
- On browser startup - clean when Chrome opens
- Periodic - clean at intervals (configurable: 30min to 24h)
- On tab close - clean when the specific domain's tab is closed
- Choose what to clean per rule: history, cookies, cache, storage
- Smart tab close detection: tracks tab URLs and only triggers rules matching the closed tab's domain
- Protect important sites from being cleaned
- Whitelisted domains are skipped by all rules and quick clean
- Subdomain-aware: whitelisting
example.comalso protectssub.example.com
- One-click cleanup runs all configured rules
- Keyboard shortcut:
Ctrl+Shift+L
- Track total items cleaned
- Breakdown by type: history entries, cookies, storage clears
- Last cleanup timestamp
- Export/import all settings as JSON (rules, whitelist, settings, stats)
- Default cleanup options configuration
- Configurable periodic interval
- XSS protection: all user-supplied domain names are HTML-escaped before rendering
- Input sanitization: domain inputs are normalized and validated
- Buttons are disabled during operations to prevent duplicate requests
- Graceful error handling for service worker communication failures
- Download or clone this repository
- Open Chrome and go to
chrome://extensions/ - Enable Developer mode (top right toggle)
- Click Load unpacked
- Select the
privacy-cleanerfolder
Click the extension icon in the toolbar:
- Type a domain name (e.g.
youtube.com,facebook.com) - Input is auto-normalized:
https://www.youtube.com/watch?v=123becomesyoutube.com - See how many history entries and cookies exist
- Click individual buttons or Clean All to remove data
- Use Quick Clean to run all configured rules at once
Right-click the extension icon > Options, or click the gear icon in the popup:
- Cleanup Rules - add/edit/delete/run automated cleanup rules
- Whitelist - manage protected domains
- Settings - configure defaults and periodic interval
- Statistics - view cleanup history and totals
| Permission | Usage |
|---|---|
history |
Search and delete browsing history by domain |
cookies |
List and remove cookies by domain |
browsingData |
Clear localStorage, cache, IndexedDB, service workers per origin |
storage |
Store extension settings, rules, and stats |
scripting |
Clear page localStorage/sessionStorage in open tabs |
tabs |
Track tab URLs for tab-close triggers, find open tabs for storage clearing |
alarms |
Schedule periodic cleanup tasks |
privacy-cleaner/
├── manifest.json # Extension manifest (MV3)
├── service-worker.js # Background: events, alarms, tab tracking, message handling
├── content-script.js # Page context: clear localStorage/sessionStorage
├── popup/
│ ├── popup.html # Popup UI
│ ├── popup.css # Popup styles (dark theme)
│ └── popup.js # Popup logic
├── options/
│ ├── options.html # Full settings page
│ ├── options.css # Settings styles
│ └── options.js # Settings logic (rules, whitelist, import/export)
├── lib/
│ ├── cleaner.js # Core cleanup (paginated search, batch delete, multi-variant)
│ └── storage.js # chrome.storage wrapper (rules, whitelist, settings, stats)
└── images/
├── icon-16.png
├── icon-48.png
└── icon-128.png
Chrome's history.search API returns max 10,000 results per call. For sites with extensive browsing history, Privacy Cleaner paginates through all results by adjusting the endTime parameter until every entry is found. It searches multiple prefixes (domain, www.domain, m.domain) and deduplicates before deleting in batches.
Cookies can be stored under various domain formats (with/without leading dot, with/without www). Privacy Cleaner queries all 6 possible variants to ensure complete cookie removal, and constructs the correct URL (http/https based on secure flag) for deletion.
The service worker maintains a Map of tab IDs to hostnames. When a tab closes, only rules matching that specific tab's domain are executed, preventing unnecessary cleanup of unrelated domains.
| Shortcut | Action |
|---|---|
Ctrl+Shift+L |
Quick clean (run all rules) |
| Component | Technology |
|---|---|
| Platform | Chrome Extension (Manifest V3) |
| Language | Vanilla JavaScript (ES Modules) |
| Storage | chrome.storage.local |
| Background | Service Worker |
| UI | Dark theme, system-ui font |
MIT