<?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.

    @app Opera
    @url https://www.opera.com/
    @os Windows, Linux
    @cleanerversion v1.6.1
    @cleanerdate 2019-03-29
    @cleanerby Andrew Ziem (2009-10-04 - 2018-11-20) & theatre-x (2014-11-04) & Tobias B. Besemer (2019-03-13 - 2019-03-29)
    @tested ok
    @testeddate
    @testedby
    @note Opera version 15 switched layout engine to Blink like Chromium
    @note Unlike Chromium, Opera does not support multiple profiles

-->
<cleaner id="opera">
  <label>Opera</label>
  <description>Web browser</description>
  <running type="exe" os="linux" same_user="true">opera</running>
  <running type="exe" os="windows" same_user="true">opera.exe</running>
  <var name="base">
    <!-- On Windows 10, Opera 68 created "Opera Stable" and "Opera Next" directories.
        The "Opera Next" is for Opera beta.
        -->
    <value os="windows" search="glob">%AppData%\Opera Software\Opera*</value>
    <value os="linux">$XDG_CONFIG_HOME/opera</value>
    <value os="linux" search="glob">~/snap/opera*/*/.config/opera*</value>
  </var>
  <var name="profile">
    <!-- Is it still needed without Default? -->
    <value os="windows" search="glob">%AppData%\Opera Software\Opera*</value>
    <value os="windows" search="glob">%AppData%\Opera Software\Opera*\Default</value>
    <value os="linux">$XDG_CONFIG_HOME/opera</value>
    <!-- examples:
        ~/snap/opera/current/.config/opera
        ~/snap/opera-beta/60/.config/opera-beta
        ~/snap/opera/420/.config/opera/Default on Opera 126 installed by snap
        -->
    <!-- Is it still needed without Default? -->
    <value os="linux" search="glob">~/snap/opera*/*/.config/opera*</value>
    <value os="linux" search="glob">~/snap/opera*/*/.config/opera*/Default</value>
  </var>
  <var name="localapp">
    <value os="windows" search="glob">%LocalAppData%\Opera Software\Opera*</value>
  </var>
  <option id="cache">
    <label>Cache</label>
    <description>Delete the web cache, which reduces time to display revisited pages</description>
    <!-- Opera 126: C:\Users\username\AppData\Roaming\Opera Software\Opera Stable\ShaderCache-->
    <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"/>
    <action command="delete" search="walk.all" path="$$profile$$/Code Cache"/>
    <action command="delete" search="walk.all" path="$$profile$$/GPUCache/"/>
    <action command="delete" search="file" path="$$profile$$/Preferences.backup"/>
    <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"/>
    <!-- suggestions.cache was found on Opera 56 but not on Google Chrome 69 -->
    <action command="delete" search="file" path="$$profile$$/suggestions_cache.json"/>
    <!-- Linux-specific -->
    <action command="delete" search="walk.files" path="$XDG_CACHE_HOME/opera/"/>
    <!-- Opera will complain if you delete ~/snap/opera/common/.cache/gdk-pixbuf-loaders.cache -->
    <action command="delete" search="walk.all" path="~/snap/opera/common/.cache/mesa_shader_cache_db"/>
    <action command="delete" search="walk.all" path="~/snap/opera/common/.cache/mesa_shader_cache"/>
    <action command="delete" search="walk.all" path="~/snap/opera/common/.cache/opera"/>
    <action command="delete" search="walk.all" path="~/snap/opera-beta/common/.cache/opera-beta"/>
    <!-- Windows-specific -->
    <action command="delete" search="walk.all" path="$$localapp$$\Cache\"/>
    <action command="delete" search="walk.all" path="$$localapp$$\Media Cache\"/>
    <!-- below are entries valid before Opera 15 -->
    <action command="delete" search="walk.files" path="%LocalAppData%\Opera\Opera*\cache\"/>
    <action command="delete" search="walk.files" path="%LocalAppData%\Opera\Opera*\opcache\"/>
    <action command="delete" search="walk.files" path="%LocalAppData%\Opera\Opera*\thumbnails\"/>
    <action command="delete" search="walk.files" path="%LocalAppData%\Opera\Opera*\profile\cache4\"/>
    <action command="delete" search="walk.files" path="%LocalAppData%\Opera\Opera*\profile\opcache\"/>
    <action command="delete" search="walk.files" path="~/.opera/cache/"/>
    <action command="delete" search="walk.files" path="~/.opera/cache4/"/>
    <action command="delete" search="walk.files" path="~/.opera/opcache/"/>
    <action command="delete" search="walk.files" path="~/.opera/thumbnails/"/>
  </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$$/Network/Cookies"/>
    <action command="delete" search="file" path="$$profile$$/Network/Cookies-journal"/>
    <action command="cookie" search="file" path="$$profile$$/Extension Cookies"/>
    <action command="delete" search="file" path="$$profile$$/Extension Cookies-journal"/>
    <!-- below are entries valid before Opera 15 -->
    <!-- example: C:\Documents and Settings\user\Application Data\Opera\Opera\cookies.txt -->
    <!-- example: C:\Documents and Settings\user\Application Data\Opera\Opera 11.00 beta\cookies.txt -->
    <action command="delete" search="glob" path="%AppData%\Opera\Opera*\cookies4.dat"/>
    <action command="delete" search="glob" path="%AppData%\Opera\Opera*\profile\cookies4.dat"/>
    <action command="delete" search="file" path="~/.opera/cookies4.dat"/>
  </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="$$profile$$/Favicons-journal"/>
    <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="file" path="$$profile$$/Visited Links"/>
    <!-- Windows-specific -->
    <action command="delete" search="walk.files" path="$$profile$$\JumpListIconsOld\"/>
    <action command="delete" search="walk.files" path="$$profile$$\JumpListIcons\"/>
    <!-- Opera 68 beta on Windows has "Jump List Icons" spelled with space -->
    <action command="delete" search="walk.files" path="$$profile$$\Jump List Icons\"/>
    <action command="delete" search="walk.files" path="$$profile$$\Jump List IconsOld\"/>
    <!-- below are entries valid before Opera 15 -->
    <action command="delete" search="glob" path="%AppData%\Opera\Opera*\download.dat"/>
    <action command="delete" search="file" path="%AppData%\Opera\Opera\profile\download.dat"/>
    <action command="delete" search="file" path="~/.opera/download.dat"/>
    <action command="delete" search="file" path="%AppData%\Opera\Opera*\search_field_history.dat"/>
    <action command="delete" search="file" path="~/.opera/search_field_history.dat"/>
    <!-- global.dat is in Opera 9, global_history.dat is in Opera 10 -->
    <action command="delete" search="file" path="%AppData%\Opera\Opera\profile\global.dat"/>
    <action command="delete" search="file" path="%AppData%\Opera\Opera\profile\typed_history.xml"/>
    <action command="delete" search="file" path="%AppData%\Opera\Opera\profile\vlink4.dat"/>
    <action command="delete" search="file" path="%LocalAppData%\Opera\Opera\profile\vps\????\md.dat"/>
    <action command="delete" search="glob" path="%AppData%\Opera\Opera*\global_history.dat"/>
    <action command="delete" search="glob" path="%AppData%\Opera\Opera*\typed_history.xml"/>
    <action command="delete" search="glob" path="%AppData%\Opera\Opera*\vlink4.dat"/>
    <action command="delete" search="glob" path="%LocalAppData%\Opera\Opera*\icons\*.gif"/>
    <action command="delete" search="glob" path="%LocalAppData%\Opera\Opera*\icons\*.ico"/>
    <action command="delete" search="glob" path="%LocalAppData%\Opera\Opera*\icons\*.idx"/>
    <action command="delete" search="glob" path="%LocalAppData%\Opera\Opera*\vps\????\md.dat"/>
    <action command="delete" search="file" path="~/.opera/global.dat"/>
    <action command="delete" search="file" path="~/.opera/global_history.dat"/>
    <action command="delete" search="file" path="~/.opera/typed_history.xml"/>
    <action command="delete" search="file" path="~/.opera/vlink4.dat"/>
    <action command="delete" search="glob" path="~/.opera/icons/*.gif"/>
    <action command="delete" search="glob" path="~/.opera/icons/*.ico"/>
    <action command="delete" search="glob" path="~/.opera/icons/*.idx"/>
    <action command="delete" search="glob" path="~/.opera/vps/????/md.dat"/>
  </option>
  <option id="site_data">
    <label>Site data</label>
    <description>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$$/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.all" path="$$profile$$/Extension State"/>
    <action command="delete" search="walk.all" path="$$profile$$/Session Storage"/>
    <!-- below are entries valid before Opera 15 -->
    <action command="delete" search="walk.all" path="%AppData%\Opera\Opera*\pstorage\"/>
    <action command="delete" search="walk.all" path="~/.opera/pstorage/"/>
  </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"/>
    <!-- below are entries valid before Opera 15 -->
    <action command="delete" search="file" path="~/.opera/wand.dat"/>
  </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/"/>
    <!-- below are entries valid before Opera 15 -->
    <action command="delete" search="glob" path="%AppData%\Opera\Opera*\sessions\autosave.win"/>
    <action command="delete" search="glob" path="%AppData%\Opera\Opera*\sessions\autosave.win.bak"/>
    <action command="delete" search="file" path="~/.opera/sessions/autosave.win"/>
    <action command="delete" search="file" path="~/.opera/sessions/autosave.win.bak"/>
  </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="$$profile$$/autoupdate_checker.sqlite"/>
    <action command="sqlite.vacuum" search="file" path="$$profile$$/Cookies"/>
    <action command="sqlite.vacuum" search="file" path="$$profile$$/Network/Cookies"/>
    <action command="sqlite.vacuum" search="file" path="$$profile$$/History"/>
    <action command="sqlite.vacuum" search="file" path="$$profile$$/Login Data"/>
    <action command="sqlite.vacuum" search="file" path="$$profile$$/Origin Bound Certs"/>
    <action command="sqlite.vacuum" search="file" path="$$profile$$/Network Action Predictor"/>
    <action command="sqlite.vacuum" search="file" path="$$profile$$/previews_opt_out.db"/>
    <action command="sqlite.vacuum" search="file" path="$$profile$$/QuotaManager"/>
    <action command="sqlite.vacuum" search="file" path="$$profile$$/WebStorage/QuotaManager"/>
    <action command="sqlite.vacuum" search="file" path="$$profile$$/Shortcuts"/>
    <action command="sqlite.vacuum" search="file" path="$$profile$$/SharedStorage"/>
    <action command="sqlite.vacuum" search="file" path="$$profile$$/Affiliation Database"/>
    <action command="sqlite.vacuum" search="file" path="$$profile$$/Trust Tokens"/>
    <action command="sqlite.vacuum" search="file" path="$$profile$$/DIPS"/>
    <action command="sqlite.vacuum" search="file" path="$$profile$$/MediaDeviceSalts"/>
    <action command="sqlite.vacuum" search="file" path="$$profile$$/ServerCertificate"/>
    <action command="sqlite.vacuum" search="file" path="$$profile$$/Reporting and NEL"/>
    <!-- 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$$/Web Data"/>
    <action command="sqlite.vacuum" search="file" path="$$profile$$/databases/Databases.db"/>
    <action command="sqlite.vacuum" search="glob" path="$$profile$$/databases/http*/?"/>
    <action command="sqlite.vacuum" search="glob" path="$$profile$$/databases/http*/??"/>
  </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>
