<?xml version="1.0" encoding="UTF-8"?>
<!--

SPDX-License-Identifier: GPL-3.0-or-later
Copyright (c) 2008-2026 Andrew Ziem.

This work is licensed under the terms of the GNU GPL, version 3 or
later.  See the COPYING file in the top-level directory.

-->
<cleaner id="google_chrome">
  <label>Google Chrome</label>
  <description>Web browser</description>
  <running type="exe" os="windows" same_user="true">chrome.exe</running>
  <running type="exe" os="linux" same_user="true">chrome</running>
  <var name="base">
    <value os="windows">%LocalAppData%\Google\Chrome\User Data</value>
    <value os="linux">$XDG_CONFIG_HOME/google-chrome</value>
    <value os="linux">~/.var/app/com.google.Chrome/config/google-chrome/</value>
    <value os="linux">~/.var/app/com.google.ChromeDev/config/google-chrome/</value>
  </var>
  <var name="profile">
    <value os="windows">%LocalAppData%\Google\Chrome\User Data\Default</value>
    <value search="glob" os="windows">%LocalAppData%\Google\Chrome\User Data\Profile *</value>
    <value os="linux">$XDG_CONFIG_HOME/google-chrome/Default</value>
    <value search="glob" os="linux">$XDG_CONFIG_HOME/google-chrome/Profile *</value>
    <value os="linux">$XDG_CONFIG_HOME/google-chrome-beta/Default</value>
    <value search="glob" os="linux">$XDG_CONFIG_HOME/google-chrome-beta/Profile *</value>
    <value os="linux">$XDG_CONFIG_HOME/google-chrome-unstable/Default</value>
    <value search="glob" os="linux">$XDG_CONFIG_HOME/google-chrome-unstable/Profile *</value>
    <value os="linux">~/.var/app/com.google.Chrome/config/google-chrome/Default</value>
    <value search="glob" os="linux">~/.var/app/com.google.Chrome/config/google-chrome/Profile *</value>
    <value os="linux">~/.var/app/com.google.ChromeDev/config/google-chrome/Default</value>
    <value search="glob" os="linux">~/.var/app/com.google.ChromeDev/config/google-chrome/Profile *</value>
  </var>
  <option id="ai">
    <label translators="Cleaning option that deletes AI models in a web browser">AI</label>
    <description>Delete the AI models</description>
    <action command="delete" search="walk.all" path="$$base$$/OnDeviceHeadSuggestModel"/>
    <action command="delete" search="walk.all" path="$$base$$/OptGuideOnDeviceModel"/>
    <action command="delete" search="walk.all" path="$$profile$$/OptGuideOnDeviceModel"/>
    <action command="delete" search="walk.all" path="$$base$$/OptGuideOnDeviceClassifierModel"/>
    <action command="delete" search="walk.all" path="$$profile$$/OptGuideOnDeviceClassifierModel"/>
  </option>
  <option id="cache">
    <label>Cache</label>
    <description>Delete the web cache, which reduces time to display revisited pages</description>
    <action command="delete" search="file" path="$$base$$/Safe Browsing Channel IDs-journal"/>
    <action command="delete" search="walk.all" path="$$base$$/component_crx_cache"/>
    <action command="delete" search="walk.all" path="$$base$$/extensions_crx_cache"/>
    <action command="delete" search="walk.all" path="$$base$$/GraphiteDawnCache"/>
    <action command="delete" search="walk.all" path="$$base$$/GrShaderCache"/>
    <action command="delete" search="walk.all" path="$$base$$/ShaderCache"/>
    <!-- Google Chrome 126 on Linux stores Network Persistent State directly under $$profile$$ while Chrome 126 on Windows stores it under $$profile$$/Network -->
    <action command="delete" search="file" path="$$profile$$/Network Persistent State"/>
    <action command="delete" search="file" path="$$profile$$/Network/Network Persistent State"/>
    <action command="delete" search="walk.all" path="$$profile$$/GPUCache/"/>
    <action command="delete" search="walk.all" path="$$profile$$/Pepper Data/Shockwave Flash/CacheWritableAdobeRoot/"/>
    <action command="delete" search="walk.all" path="$$profile$$/Storage/ext/*/*def/GPUCache"/>
    <action command="json" search="file" path="$$profile$$/Preferences" address="dns_prefetching/host_referral_list"/>
    <action command="json" search="file" path="$$profile$$/Preferences" address="dns_prefetching/startup_list"/>
    <action command="json" search="file" path="$$profile$$/Preferences" address="net/http_server_properties/servers"/>
    <action command="json" search="file" path="$$base$$/Local State" address="HostReferralList"/>
    <action command="json" search="file" path="$$base$$/Local State" address="StartupDNSPrefetchList"/>
    <!-- Linux-specific -->
    <action command="delete" search="walk.files" path="$XDG_CACHE_HOME/google-chrome/"/>
    <action command="delete" search="walk.files" path="$XDG_CACHE_HOME/google-chrome-beta/"/>
    <action command="delete" search="walk.files" path="$XDG_CACHE_HOME/google-chrome-unstable/"/>
    <action command="delete" search="walk.files" path="~/.var/app/com.google.Chrome/cache/"/>
    <action command="delete" search="walk.files" path="~/.var/app/com.google.ChromeDev/cache/"/>
    <!-- Windows-specific -->
    <action command="delete" search="glob" path="$$base$$\B*.tmp"/>
    <action command="delete" search="walk.all" path="$$profile$$\Default\Application Cache\"/>
    <action command="delete" search="walk.files" path="$$profile$$\Cache\"/>
    <!-- Linux stores the Code Cache under ~/.cache/ , so it doesn't need an extra rule -->
    <action command="delete" search="walk.files" path="$$profile$$\Code Cache\"/>
    <action command="delete" search="walk.files" path="$$profile$$\Media Cache\"/>
  </option>
  <option id="cookies">
    <label>Cookies</label>
    <description>Delete cookies, which store login information, website preferences, and tracking identifiers</description>
    <action command="cookie" search="file" path="$$profile$$/Cookies"/>
    <action command="delete" search="file" path="$$profile$$/Cookies-journal"/>
    <action command="cookie" search="file" path="$$profile$$/Extension Cookies"/>
    <action command="delete" search="file" path="$$profile$$/Extension Cookies-journal"/>
    <action command="cookie" search="file" path="$$profile$$/Network/Cookies"/>
    <action command="delete" search="file" path="$$profile$$/Network/Cookies-journal"/>
  </option>
  <option id="crash_reports">
    <label>Crash reports</label>
    <description>Delete the files</description>
    <action command="delete" search="walk.all" path="$$base$$/Crash Reports/"/>
  </option>
  <option id="form_history">
    <label>Form history</label>
    <description>A history of forms entered in websites</description>
    <action command="chrome.autofill" search="file" path="$$profile$$/Web Data"/>
  </option>
  <option id="history">
    <label>History</label>
    <description>Delete the history which includes visited sites, downloads, and thumbnails</description>
    <!-- keep /History before /Favicons -->
    <action command="chrome.history" search="file" path="$$profile$$/History"/>
    <action command="chrome.favicons" search="file" path="$$profile$$/Favicons"/>
    <action command="delete" search="file" path="$$base$$/chrome_shutdown_ms.txt"/>
    <action command="delete" search="file" path="$$base$$/Safe Browsing Cookies-journal"/>
    <action command="delete" search="file" path="$$profile$$/Archived History-journal"/>
    <action command="delete" search="file" path="$$profile$$/Archived History"/>
    <action command="delete" search="file" path="$$profile$$/DownloadMetadata"/>
    <action command="delete" search="file" path="$$profile$$/DIPS"/>
    <action command="delete" search="file" path="$$profile$$/History Provider Cache"/>
    <action command="delete" search="file" path="$$profile$$/History-journal"/>
    <action command="delete" search="file" path="$$profile$$/MediaDeviceSalts-journal"/>
    <action command="delete" search="file" path="$$profile$$/MediaDeviceSalts"/>
    <action command="delete" search="file" path="$$profile$$/Network Action Predictor-journal"/>
    <action command="delete" search="file" path="$$profile$$/Network Action Predictor"/>
    <action command="delete" search="file" path="$$profile$$/Origin Bound Certs-journal"/>
    <action command="delete" search="file" path="$$profile$$/Reporting and NEL-journal"/>
    <action command="delete" search="file" path="$$profile$$/Reporting and NEL"/>
    <action command="delete" search="file" path="$$profile$$/Shortcuts-journal"/>
    <action command="delete" search="file" path="$$profile$$/Shortcuts"/>
    <action command="delete" search="glob" path="$$profile$$/History Index ????-??-journal"/>
    <action command="delete" search="glob" path="$$profile$$/History Index ????-??"/>
    <!-- Before about January 2016 Thumbnails was an SQLite file, by Google Chrome 48 it is a folder -->
    <action command="delete" search="file" path="$$profile$$/Thumbnails"/>
    <action command="delete" search="walk.files" path="$$profile$$/Thumbnails"/>
    <action command="delete" search="file" path="$$profile$$/Thumbnails-journal"/>
    <action command="delete" search="file" path="$$profile$$/Top Sites-journal"/>
    <action command="delete" search="file" path="$$profile$$/Top Sites"/>
    <action command="delete" search="file" path="$$profile$$/Visited Links"/>
    <action command="json" search="file" path="$$profile$$/Preferences" address="prefetch/search_prefetch/cache"/>
    <action command="json" search="file" path="$$profile$$/Preferences" address="zerosuggest/cachedresults"/>
    <action command="json" search="file" path="$$profile$$/Preferences" address="zerosuggest/cachedresults_with_url"/>
    <!-- Windows-specific -->
    <action command="delete" search="walk.files" path="$$profile$$\JumpListIconsMostVisited\"/>
    <action command="delete" search="walk.files" path="$$profile$$\JumpListIconsOld\"/>
    <action command="delete" search="walk.files" path="$$profile$$\JumpListIconsRecentClosed\"/>
    <action command="delete" search="walk.files" path="$$profile$$\JumpListIcons\"/>
  </option>
  <option id="search_engines">
    <label>Search engines</label>
    <description translators="'Factory' means a search engine that is installed by default 'from the factory,' but this is different than a 'default search engine' https://lists.launchpad.net/launchpad-translators/msg00283.html">Reset the search engine usage history and delete non-factory search engines, some of which are added automatically</description>
    <action command="chrome.keywords" search="file" path="$$profile$$/Web Data"/>
  </option>
  <option id="session">
    <label>Session</label>
    <description>Previously open tabs and windows</description>
    <action command="delete" search="file" path="$$profile$$/Current Session"/>
    <action command="delete" search="file" path="$$profile$$/Current Tabs"/>
    <action command="delete" search="file" path="$$profile$$/Last Session"/>
    <action command="delete" search="file" path="$$profile$$/Last Tabs"/>
    <action command="delete" search="walk.all" path="$$profile$$/Sessions"/>
  </option>
  <option id="site_data">
    <label translators="Label for cleaning option to delete site data such as LocalStorage and IndexedDB">Site data</label>
    <description translators="Description for cleaning option. LocalStorage and IndexedDB are proper nouns: do not translate">Delete LocalStorage, IndexedDB, and other data stored by websites</description>
    <action command="chrome.databases_db" search="file" path="$$profile$$/databases/Databases.db"/>
    <action command="delete" search="walk.all" path="$$profile$$/databases/http*/"/>
    <action command="delete" search="walk.all" path="$$profile$$/File System"/>
    <action command="delete" search="walk.all" path="$$profile$$/IndexedDB"/>
    <action command="delete" search="walk.all" path="$$profile$$/Local Storage"/>
    <action command="delete" search="walk.all" path="$$profile$$/Pepper Data/Shockwave Flash/WritableRoot/"/>
    <action command="delete" search="walk.all" path="$$profile$$/Service Worker"/>
    <action command="delete" search="walk.all" path="$$profile$$/WebStorage"/>
    <action command="delete" search="file" path="$$profile$$/QuotaManager"/>
    <action command="delete" search="file" path="$$profile$$/QuotaManager-journal"/>
    <action command="delete" search="walk.files" path="$$profile$$/Session Storage/"/>
  </option>
  <option id="sync">
    <label>Sync</label>
    <description>Delete the sync data (including web apps) and sign out of the browser</description>
    <action command="delete" search="walk.files" path="$$profile$$/Sync Data/"/>
    <action command="delete" search="walk.files" path="$$profile$$/Sync Data Backup/"/>
    <action command="json" search="file" path="$$base$$/Local State" address="profile"/>
    <action command="json" search="file" path="$$profile$$/Preferences" address="account_info"/>
    <action command="json" search="file" path="$$profile$$/Preferences" address="google_services"/>
    <action command="json" search="file" path="$$profile$$/Preferences" address="sync"/>
  </option>
  <option id="passwords">
    <label>Passwords</label>
    <description>A database of usernames and passwords as well as a list of sites that should not store passwords</description>
    <warning>This option will delete your saved passwords.</warning>
    <action command="delete" search="file" path="$$profile$$/Login Data"/>
    <action command="delete" search="file" path="$$profile$$/Login Data-journal"/>
  </option>
  <option id="vacuum">
    <label>Vacuum</label>
    <description>Clean database fragmentation to reduce space and improve speed without removing any data</description>
    <action command="sqlite.vacuum" search="file" path="$$base$$/first_party_sets.db"/>
    <action command="sqlite.vacuum" search="file" path="$$profile$$/Account Web Data"/>
    <action command="sqlite.vacuum" search="file" path="$$profile$$/Affiliation Database"/>
    <action command="sqlite.vacuum" search="file" path="$$profile$$/AggregationService"/>
    <action command="sqlite.vacuum" search="file" path="$$profile$$/BrowsingTopicsSiteData"/>
    <action command="sqlite.vacuum" search="file" path="$$profile$$/CdmStorage.db"/>
    <action command="sqlite.vacuum" search="file" path="$$profile$$/Conversions"/>
    <action command="sqlite.vacuum" search="file" path="$$profile$$/Cookies"/>
    <action command="sqlite.vacuum" search="file" path="$$profile$$/DIPS"/>
    <action command="sqlite.vacuum" search="file" path="$$profile$$/Extension Cookies"/>
    <action command="sqlite.vacuum" search="file" path="$$profile$$/Favicons-journal"/>
    <action command="sqlite.vacuum" search="file" path="$$profile$$/Favicons"/>
    <action command="sqlite.vacuum" search="file" path="$$profile$$/heavy_ad_intervention_opt_out.db"/>
    <action command="sqlite.vacuum" search="file" path="$$profile$$/History"/>
    <action command="sqlite.vacuum" search="file" path="$$profile$$/HistoryEmbeddings"/>
    <action command="sqlite.vacuum" search="file" path="$$profile$$/InterestGroups"/>
    <action command="sqlite.vacuum" search="file" path="$$profile$$/KAnonymityService"/>
    <action command="sqlite.vacuum" search="file" path="$$profile$$/Login Data For Account"/>
    <action command="sqlite.vacuum" search="file" path="$$profile$$/Login Data"/>
    <action command="sqlite.vacuum" search="file" path="$$profile$$/MediaDeviceSalts"/>
    <action command="sqlite.vacuum" search="file" path="$$profile$$/Network Action Predictor"/>
    <action command="sqlite.vacuum" search="file" path="$$profile$$/Origin Bound Certs"/>
    <action command="sqlite.vacuum" search="file" path="$$profile$$/previews_opt_out.db"/>
    <action command="sqlite.vacuum" search="file" path="$$profile$$/PrivateAggregation"/>
    <action command="sqlite.vacuum" search="file" path="$$profile$$/QuotaManager"/>
    <action command="sqlite.vacuum" search="file" path="$$profile$$/Reporting and NEL"/>
    <action command="sqlite.vacuum" search="file" path="$$profile$$/Safe Browsing Cookies"/>
    <action command="sqlite.vacuum" search="file" path="$$profile$$/ServerCertificate"/>
    <action command="sqlite.vacuum" search="file" path="$$profile$$/SharedStorage"/>
    <action command="sqlite.vacuum" search="file" path="$$profile$$/Shortcuts"/>
    <action command="sqlite.vacuum" search="glob" path="$$profile$$/History Index ????-??"/>
    <!-- Before about January 2016 Thumbnails was an SQLite file, by Google Chrome 48 it is a folder -->
    <action command="sqlite.vacuum" search="file" path="$$profile$$/Thumbnails" type="f"/>
    <action command="sqlite.vacuum" search="file" path="$$profile$$/Top Sites"/>
    <action command="sqlite.vacuum" search="file" path="$$profile$$/Trust Tokens"/>
    <action command="sqlite.vacuum" search="file" path="$$profile$$/Collaboration/MessageDB"/>
    <action command="sqlite.vacuum" search="file" path="$$profile$$/DataSharing/DataSharingDB"/>
    <action command="sqlite.vacuum" search="file" path="$$profile$$/Web Data"/>
    <!-- one or more levels below $$profile$$ -->
    <action command="sqlite.vacuum" search="file" path="$$profile$$/databases/Databases.db"/>
    <action command="sqlite.vacuum" search="file" path="$$profile$$/Shared Dictionary/db"/>
    <action command="sqlite.vacuum" search="file" path="$$profile$$/Sync Data/SyncData.sqlite3"/>
    <action command="sqlite.vacuum" search="file" path="$$profile$$/WebStorage/QuotaManager"/>
    <action command="sqlite.vacuum" search="glob" path="$$profile$$/databases/http*/??"/>
    <action command="sqlite.vacuum" search="glob" path="$$profile$$/databases/http*/?"/>
    <!-- The three below were seen on Google Chrome on Windows before Chrome version 66 -->
    <action command="sqlite.vacuum" search="file" path="%LocalAppData%\Google\Chrome\User Data\Default\Archived History"/>
    <action command="sqlite.vacuum" search="file" path="%LocalAppData%\Google\Chrome\User Data\Default\Plugin Data\Google Gears\localserver.db"/>
    <action command="sqlite.vacuum" search="file" path="%LocalAppData%\Google\Chrome\User Data\Default\Plugin Data\Google Gears\permissions.db"/>
  </option>
  <option id="site_preferences">
    <label>Site preferences</label>
    <description>Settings for individual sites</description>
    <action command="json" search="file" path="$$profile$$/Preferences" address="profile/content_settings/exceptions"/>
  </option>
</cleaner>
