I have always been a little curious about what websites leave behind in my browser. Not paranoid (ok, a little), just… curious. Turns out, the answer is “a lot more than you’d think.”
So I built something about it.
Full disclosure, I built this using AI. But it was a guided build. I had the idea, discussions with Claude, made a PRD, and fed it to Claude Code. From there, there was revisions, further discussion, and some babysitting.
CookieTrap is a Firefox browser extension that shows you exactly what a website has stored in your browser – cookies, localStorage, sessionStorage – and lets you delete it. All from a single panel, right in your sidebar.
It is not an ad blocker. It does not stop anything from loading. Think of your browser’s built-in cookie settings as a sledgehammer. This is the scalpel version.
What it actually does
Open the panel and you see what the current tab has stored. Switch tabs, it updates. You can delete one item, or nuke everything at once. There is also a per-domain toggle – flip it on for a site and when you close the last tab for that domain, CookieTrap automatically wipes everything it left behind.
The part I find most interesting is the third-party tracker view. When you visit a site, other domains can tag along and set their own cookies through embedded scripts and tracking pixels. CookieTrap catches those and tells you which tracker showed up, and which site it rode in on. That “why am I still seeing ads for that thing I looked at three weeks ago” moment? This is why.
How it was built
No frameworks, no build tools, no bundler. Vanilla JavaScript. The source files ARE the extension – clone the repo, point Firefox at the manifest, and it runs. For something that is supposed to give you transparency, it felt wrong to make the extension itself a black box.
The architecture is straightforward: a few background modules handling tab tracking, request logging, and deletion, with a content script that reads localStorage only when asked and does nothing else on its own. Everything communicates through Firefox’s message passing API.
One interesting tradeoff: instead of shipping the full Public Suffix List (a 10,000+ entry file) to parse base domains, I maintain a curated set of about 80 common multi-part TLDs. It covers the vast majority of real browsing. An obscure edge case might not parse correctly – acceptable for a tool showing you your own data.
No telemetry. No analytics. No external servers. The extension asks for broad permissions because it needs them to function. Adding any data collection on top of that would defeat the entire point.
Where it lives
If you use Firefox and have ever wondered what’s sitting in your browser during/after a session, give it a look. This does not replace your browser’s built-in option to clear cookies on close – but you do not have to wait until then to clean things up.
CookieTrap is available on the Firefox Add-ons store and the source is on GitHub under GPL v3.