This repository contains a basic CCleaner extension stub to be installed within Avast Secure Browser (ASB). As a Chromium based browser, ASB supports the Chrome extension framework, making this extension also compatible with Chrome and other Chromium based browsers.
As a very first step, we recommend you read the What are Extensions?, Getting Started Tutorial and Overview pages of the Google Chrome extension documentation as this will help familarise you with the structure of extensions.
Extensions can be loaded in unpacked mode by following these steps in ASB:
- Visit
secure://extensions(via: Menu -> More Tools -> Extensions). - Enable
Developer modeby ticking the checkbox in the upper-right corner. - Click on the "Load unpacked extension..." button.
- Select the directory containing the unpacked extension (e.g. src)
Chrome already has a set of extension APIs for cleaning/removing browsing data: chrome.browsingData. We have extended these APIs to provide special cleaning and reporting functionality specifically for our browser:
-
Added a
tillremoval option - this has the same format assincebut marks the end timestamp of the cleaning. -
Added
chrome.browsingData.reportCleanResultsfunction which saves the passed JSON into a temporary file, looks for CCleaner installation path in the registry and executes it with/reportargument pointing to the temporary file. -
Added cleaning results data as an object argument for callback in
chrome.browsingData.remove()and other remove functions. The format is a dictionary with data types that were requested to be cleaned. Each data type has acount(i.e. total number of entries) and anentriesarray of objects. Inside theentriesarray, there ispathandsizeinformation. Thepathmay be a URL or some other identifier (e.g.profile:guidfor form data). Thesizeinformation is represented in bytes and is non-zero only for some data types (e.g.cache).