Uday Sheth Uday Sheth Logo
Firefox Extension ยท Published

Ghost Clean

A privacy-focused Firefox extension for quickly cleaning browser data, managing site-specific data, and automating routine cleanup.

JavaScript WebExtensions API Firefox Browser Privacy

The problem

Firefox already provides powerful tools for clearing browsing data, but accessing them regularly means moving through browser settings and managing several different categories manually.

For users who frequently want a clean browser - whether for privacy, testing, development, or simply starting fresh - that process can become unnecessarily repetitive.

I wanted to turn that routine into something much simpler: a dedicated browser tool that makes cleanup fast while still giving users control over what gets removed.

What it does

Ghost Clean provides a compact dashboard for managing common Firefox data and cleaning it without navigating through the browser's settings.

The extension supports both complete browser cleanup and targeted cleanup of the website currently open in the active tab.

  • One-click browser-wide cleanup.
  • Live counts for history, cookies, and downloads.
  • Clean data belonging to the current website.
  • Cookie whitelist for keeping selected sites signed in.
  • Automatic daily, weekly, or startup cleanup.
  • Cache, local storage, and IndexedDB cleanup.
  • Saved password and download-history cleanup.
  • Local lifetime cleanup statistics.

The dashboard

Instead of presenting users with a collection of unrelated browser actions, Ghost Clean brings the main cleanup categories into a single compact dashboard.

Users can see useful information about their browser data and choose between a complete cleanup or individual actions where supported.

The goal is to make browser maintenance feel like a simple, understandable task rather than a trip through a settings menu.

Clean All

The Clean All action uses a shared background cleaning engine to remove the major categories of browser data in one operation.

This includes browsing history, cookies, Firefox cache, local storage, IndexedDB, download history, and saved passwords.

Whitelisted domains are preserved when cookies are removed, allowing users to keep selected websites signed in while still cleaning the rest of their browser data.

After a successful full cleanup, Ghost Clean opens a fresh Firefox tab, closes the other open tabs, and displays a completion prompt.

Clean This Site

Full browser cleanup isn't always what a user needs. Ghost Clean also provides a site-specific cleaning mode for the website currently open in the active tab.

Site cleaning can remove cookies, local storage, IndexedDB, and service worker registrations associated with that hostname.

Global browser cache is intentionally excluded from this mode because Firefox does not provide hostname-filtered cache removal through its browsing-data API.

Cookie whitelist

One of the more important usability problems with aggressive browser cleanup is being signed out of everything afterward.

Ghost Clean addresses this with a local cookie whitelist. Users can add domains manually or add the currently open site, and matching cookies are preserved during both manual and scheduled cleanup.

Whitelist entries are stored locally using Firefox extension storage rather than being sent to an external service.

Automatic cleaning

Ghost Clean can run the same cleaning engine automatically in the background.

Users can choose between manual-only cleaning, daily cleaning, weekly cleaning, or cleanup whenever Firefox starts.

The extension also records the last automatic cleanup locally so the schedule interface can show when the previous run occurred.

How it's built

Ghost Clean is built around Firefox's WebExtensions APIs, with the actual cleanup logic handled by a shared background engine.

This keeps manual cleanup and scheduled cleanup using the same underlying implementation rather than maintaining separate cleaning paths.

The extension uses Firefox permissions including history, cookies, browsingData, tabs, activeTab, downloads, storage, and alarms for its various browser-management features.

Privacy by design

Ghost Clean is designed around keeping the browser data it manages on the user's device.

The extension does not send browsing history, website URLs, cookies, saved passwords, download activity, local storage, IndexedDB contents, page contents, search queries, or the lifetime cleanup counter to its telemetry service.

The project does use a small anonymous heartbeat for active-user measurement. A random UUID is generated and stored locally, and the opaque identifier is sent to the project's telemetry endpoint at most approximately once per day.

The heartbeat is intentionally separated from browsing activity, browser fingerprints, extension-version history, and page-level activity.

Lifetime cleanup statistics

Ghost Clean maintains a local counter showing how many countable browser records have been removed over time.

The statistic is based on removable history entries, cookies, and download-history entries and remains stored locally on the device.

Why I built it

Ghost Clean started from a simple frustration: browser cleanup shouldn't require repeatedly digging through settings.

What began as a small one-click cleanup idea grew into a more complete browser-maintenance tool with selective cleanup, cookie preservation, scheduling, statistics, and a focused privacy model.

That progression is probably the most interesting part of the project for me โ€” taking a very small utility and gradually turning it into something that solves the surrounding usability problems as well.

What I learned

Building Ghost Clean gave me deeper experience with Firefox's extension architecture, browser data APIs, background processing, scheduled tasks, local extension storage, and permission design.

It also made the relationship between functionality and permissions much more important. A browser extension needs to be clear about why it requests access, especially when it works with sensitive browser data.

Published project

Ghost Clean is publicly available as a Firefox Add-on, with the source code and implementation details available on GitHub.