Chrome clear on exit with keep sites
Clears Chrome browsing data on exit while keeping selected website logins.
Author: haniobaid
Clear Chrome's browsing data when its last window closes normally, while keeping
login cookies and ordinary site storage for domains you choose. Chrome performs
the deletion. The mod supplies its settings through Chrome's native policy reader.
Cleanup is off by default. Review the keep list, then turn on Enable automatic
cleanup in the mod's Settings tab. The list starts empty: enabling cleanup with
no exceptions signs you out of most websites. Deleted data cannot be recovered.
Enter domains such as example.com; subdomains are included. Full HTTP/HTTPS URLs
are accepted, with their paths and ports ignored. Use ASCII/punycode domain names.
Check your configuration
Restart Chrome after installing the mod. At chrome://policy, select Reload
policies and check these three entries:
ClearBrowsingDataOnExitList: browsing history, download history, cached images
and files, autofill, site settings, and hosted-app data, for all time.
DefaultCookiesSetting: 4, making ordinary site storage session-only.
CookiesAllowedForUrls: your keep list, preserving cookies and ordinary storage.
The keep list does not preserve history, cache, permissions, or legacy hosted-app
storage. Downloaded files, bookmarks, and saved passwords are not selected for
deletion. Websites can still expire their own sessions or require a new login.
Chrome already exposes the cookie/storage controls at
chrome://settings/content/siteData. This mod sets those controls and their
Allowed to save data on your device exceptions from one Windhawk keep list,
and adds the broader exit cleanup policy which has no equivalent Chrome setting.
Another clearing extension or an existing Chrome cleanup rule can still remove
the data you intended to keep.
Changes and removal
After changing settings, use Reload policies to verify the result. The mod
also requests a refresh when it has observed Chrome registering its policy events.
Chrome processes these requests asynchronously; the mod cannot acknowledge when
Chrome has finished applying them.
To stop cleanup, turn the setting off or disable the mod, then Reload policies
before closing Chrome and confirm that the supplied entries have disappeared.
Chrome can otherwise retain its cached policies for the remainder of that session.
The next Chrome start with the mod disabled receives no policies from this mod.
No administrator prompt, PowerShell helper, or policy-removal permission is needed.
The mod runs only in Chrome's browser process and does not change its real policy
registry keys or profile files. It uses private temporary storage within
Windhawk's mod storage while cleanup is enabled. Inactive files can remain after
Chrome exits; a later enabled start attempts to remove verified leftovers when
they are no longer in use. These files are never reused as configuration or
needed for backup.
Scope and limitations
- Applies to all profiles in each Chrome browser process that loads the mod.
Chrome must be allowed to load Windhawk mods.
- Intended for personal installations. Conflicting existing local Chrome policies
prevent injection; they are never replaced. Chrome's normal cloud-policy
precedence still applies. Check Windhawk's mod log if the entries do not appear.
- If a policy view cannot be prepared, Chrome uses its genuine policies for that
load. The mod logs the reason; check the policy page to confirm cleanup is active.
If private storage could not be initialized, save the mod's settings again to
retry. Once storage is ready, reloading Chrome policies retries a failed read.
- Chrome can show Managed by your organization while these policies are active.
Chrome also disables synchronization of affected data categories.
- Normal last-window close is the supported cleanup path. Crashes, forced
termination, Windows shutdown, and some restart/quit paths can
prevent completion or defer selective site-data deletion until the next start.
- Disabling the mod cannot restore browsing data Chrome has already deleted.
Back up the source and your Windhawk settings to reproduce the configuration on a
fresh Windows installation. The source's defaults do not contain your saved list.
References