How-to · Privacy

How to clear site data on tab close in Chrome

CookieVault3 分で読了

結論から言うと

Deleting cookies isn't enough — sites also persist state in localStorage, IndexedDB, Cache Storage and service workers. Set an auto-cleaner to "clean on close", enable its optional site-data switch, and each site's entire storage footprint is wiped seconds after you close its last tab — except the domains you whitelist.

  1. 1

    Install CookieVault Guardian — by default it deletes nothing, so nothing happens until you opt in.

  2. 2

    In the popup, set the global default action to "clean on close".

  3. 3

    Enable "Also clear site data" — Guardian requests the optional browsingData permission at that moment, not at install.

  4. 4

    Add allow rules for domains that should keep their logins and data; wildcards like *.example.com cover sub-domains.

  5. 5

    Close a throwaway site's tab and check the activity log to confirm its cookies and site data were cleared.

Clearing cookies used to be the whole job. Today a site that wants to remember you has four more places to do it: localStorage, IndexedDB, Cache Storage and registered service workers all survive cookie deletion, and some tracking setups use exactly that to re-identify you after a "cleanup". Chrome's own answer is blunt — a global "delete data when you close all windows" toggle that logs you out of everything, once per browser session. What you actually want is per-site and continuous: the moment you close a site's last tab, that site's entire storage footprint goes away, while your trusted sites stay logged in.

Start with an auto-cleaner on "clean on close"

CookieVault Guardian — our MV3-native, MIT-licensed cleaner — is built around that model. Install it, open the popup, and set the global default action to clean on close. From then on, closing the last tab of a domain deletes its cookies within seconds, with a 30-second background sweep as a safety net. The full whitelist workflow is covered in auto-delete cookies except a whitelist.

Turn on "Also clear site data"

This is the switch this guide is about. Enable Also clear site data and Guardian asks for Chrome's browsingData permission at that moment — it's an optional permission, deliberately not part of the install. Once granted, every cleanup goes further than cookies: the cleaned site's localStorage, IndexedDB, Cache Storage, service workers and file-system storage are removed too, scoped to the affected origins only. Nothing else in your browser is touched. Turn the option off and Guardian gives the permission back.

Whitelist what should survive

Add allow rules for the sites whose logins and local state you want to keep — mail, banking, work tools. Wildcards like *.example.com cover sub-domains in one rule. Whitelisted sites keep cookies and site data; everything else is wiped on close.

What this does not do — honestly

Guardian is not a cache cleaner. It never touches Chrome's HTTP disk cache, and it only clears data for sites it just cleaned — there's no "wipe everything" button. If you're after a full cache purge (say, to force-reload assets while developing), use Chrome's built-in Clear browsing data (Ctrl/Cmd+Shift+Del); the Cache Storage that Guardian clears is the service-worker cache belonging to the cleaned site, which is what matters for the site remembering you.

Verify it in the activity log

Every cleanup is recorded in a local activity log with timestamps — open the popup and you can see exactly which sites were cleaned and when. The log stays on your machine: Guardian makes no network requests and ships no analytics, and being open source, both claims are auditable.

Close the tab, close the trail

Cookies, localStorage, IndexedDB and service workers wiped on tab close — whitelist what matters, audit the rest in a local log.

See CookieVault →