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

    BleachBit
    Copyright (C) 2008-2025 Andrew Ziem
    https://www.bleachbit.org

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.


-->
<cleaner id="zen">
  <label>Zen</label>
  <description>Web browser</description>
  <running type="exe" os="unix" same_user="true">zen-browser</running>
  <running type="exe" os="windows" same_user="true">zen-browser.exe</running>
  <running type="pathname">~/.zen/*.default/lock</running>
  <running type="pathname">~/snap/zen/common/.zen/*.default/lock</running>
  <running type="pathname">~/.var/app/app.zen_browser.zen/.zen/*.default*/lock</running>
  <var name="base">
    <value os="windows">%AppData%\Zen</value>
    <value os="linux">~/.zen</value>
    <value os="linux">~/snap/zen/common/.zen</value>
    <value os="linux">~/.var/app/app.zen_browser.zen/.zen</value>
    <value os="freebsd">~/.zen</value>
    <value os="openbsd">~/.zen</value>
  </var>
  <var name="profile">
    <value search="glob" os="windows">%AppData%\Zen\Profiles\*</value>
    <value search="glob" os="linux">~/.zen/*</value>
    <value search="glob" os="linux">~/snap/zen/common/.zen/*</value>
    <value search="glob" os="linux">~/.var/app/app.zen_browser.zen/.zen/*</value>
    <value search="glob" os="freebsd">~/.zen/*</value>
    <value search="glob" os="openbsd">~/.zen/*</value>
  </var>
  <option id="backup">
    <label>Backup files</label>
    <description>Delete the backup files</description>
    <action command="delete" search="glob" path="$$profile$$/bookmarkbackups/*.json"/>
    <action command="delete" search="glob" path="$$profile$$/bookmarkbackups/*.jsonlz4"/>
  </option>
  <option id="cache">
    <label>Cache</label>
    <description>Delete the cache</description>
    <!--
This Linux path is whitelisted under the System - Cache cleaner, so it is not
redundant. Also, this Linux path contains the cache2 and OfflineCache directories.
-->
    <action command="delete" search="walk.all" path="~/.cache/zen/"/>
    <action command="delete" search="walk.all" path="~/snap/zen/common/.zen/mozilla/"/>
    <action command="delete" search="walk.all" path="~/.var/app/app.zen_browser.zen/cache/zen/"/>
    <action command="delete" search="walk.all" path="%LocalAppData%\Zen\Profiles\*\cache2"/>
    <action command="delete" search="walk.all" path="%LocalAppData%\Zen\Profiles\*\jumpListCache"/>
    <action command="delete" search="walk.all" path="%LocalAppData%\Zen\Profiles\*\OfflineCache"/>
    <!--
This file no longer exists in Firefox <=62

Necko Predictive Network Actions
https://wiki.mozilla.org/Privacy/Reviews/Necko
-->
    <action command="delete" search="file" path="$$profile$$/netpredictions.sqlite"/>
  </option>
  <option id="cookies">
    <label>Cookies</label>
    <description>Delete cookies, which store login information, website preferences, and tracking identifiers</description>
    <action command="delete" search="file" path="$$profile$$/cookies.txt"/>
    <action command="cookie" search="file" path="$$profile$$/cookies.sqlite"/>
  </option>
  <option id="crash_reports">
    <label>Crash reports</label>
    <description>Delete the files</description>
    <action command="delete" search="walk.all" path="$$base$$/Crash Reports/"/>
    <action command="delete" search="glob" path="$$profile$$/minidumps/*.dmp"/>
  </option>
  <option id="forms">
    <label>Form history</label>
    <description>Saved form entries and search bar history</description>
    <action command="delete" search="file" path="$$profile$$/formhistory.dat"/>
    <action command="delete" search="file" path="$$profile$$/formhistory.sqlite"/>
  </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>
    <!-- http://kb.mozillazine.org/Password_Manager -->
    <action command="delete" search="file" path="$$profile$$/signons.txt"/>
    <action command="delete" search="file" path="$$profile$$/signons2.txt"/>
    <action command="delete" search="file" path="$$profile$$/signons3.txt"/>
    <action command="delete" search="file" path="$$profile$$/signons.sqlite"/>
    <action command="delete" search="file" path="$$profile$$/logins.json"/>
  </option>
  <option id="session">
    <label>Session</label>
    <description>Previously open tabs and windows</description>
    <!--
example names
sessionstore.js
sessionstore.jsonlz4
sessionstore.bak
sessionstore.bak-20140715214327
sessionstore-1.js
upgrade.jsonlz4-20180905220717
sessionCheckpoints.json
sessionstore-backups/recovery.bak
sessionstore-backups/recovery.baklz4
sessionstore-backups/recovery.js
sessionstore-backups/recovery.jsonlz4
-->
    <action command="delete" search="file" path="$$profile$$/sessionCheckpoints.json"/>
    <action command="delete" search="glob" path="$$profile$$/sessionstore*.js*"/>
    <action command="delete" search="glob" path="$$profile$$/sessionstore.bak*"/>
    <action command="delete" search="glob" path="$$profile$$/sessionstore-backups/previous.js*"/>
    <action command="delete" search="glob" path="$$profile$$/sessionstore-backups/recovery.js*"/>
    <action command="delete" search="glob" path="$$profile$$/sessionstore-backups/recovery.bak*"/>
    <action command="delete" search="file" path="$$profile$$/sessionstore-backups/previous.bak"/>
    <action command="delete" search="glob" path="$$profile$$/sessionstore-backups/upgrade.js*-20*"/>
  </option>
  <option id="site_data">
    <label>Site data</label>
    <description>Delete LocalStorage, IndexedDB, and other data stored by websites</description>
    <action command="delete" search="walk.all" path="$$profile$$/storage/default/http*"/>
    <action command="delete" search="glob" path="$$profile$$/storage/default/http*"/>
    <action command="delete" search="file" path="$$profile$$/webappsstore.sqlite"/>
  </option>
  <option id="site_preferences">
    <label>Site preferences</label>
    <description>Settings for individual sites</description>
    <action command="delete" search="file" path="$$profile$$/content-prefs.sqlite"/>
  </option>
  <option id="url_history">
    <label>URL history</label>
    <description>List of visited web pages</description>
    <action command="delete" search="file" path="$$profile$$/SiteSecurityServiceState.txt"/>
    <action command="delete" search="walk.all" path="%LocalAppData%\Zen\Profiles\*\thumbnails"/>
    <!-- Firefox versions 1 and 2 -->
    <action command="delete" search="file" path="$$profile$$/history.dat"/>
    <action command="delete" search="file" path="$$profile$$/downloads.rdf"/>
    <!-- Firefox 3 introduced downloads.sqlite and places.sqlite -->
    <action command="delete" search="file" path="$$profile$$/downloads.sqlite"/>
    <action command="mozilla.url.history" search="file" path="$$profile$$/places.sqlite"/>
    <!-- Firefox 78 (or probably some previous version) moved icons from places.sqlite to favicons.sqlite -->
    <action command="mozilla.favicons" search="file" path="$$profile$$/favicons.sqlite"/>
    <!-- Firefox 108 has alternative services with visited domains -->
    <action command="delete" search="file" path="$$profile$$/AlternateServices.txt"/>
  </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="glob" path="$$profile$$/*.sqlite"/>
  </option>
</cleaner>
