Documentation: Chrome Browsing Data API
A promise-based wrapper for the Chrome browsingData API.
- isAvailableBrowsingData()
- removeBrowsingData(options, dataToRemove)
- removeAppcacheData(options?)
- removeCacheData(options?)
- removeCacheStorageData(options?)
- removeCookiesData(options?)
- removeDownloadsData(options?)
- removeFileSystemsData(options?)
- removeFormData(options?)
- removeHistoryData(options?)
- removeIndexedDBData(options?)
- removeLocalStorageData(options?)
- removePasswordsData(options?)
- removeServiceWorkersData(options?)
- removeWebSQLData(options?)
- getBrowsingDataSettings()
isAvailableBrowsingData(): booleanReturns true when the browsingData namespace is present on the API selected by browser() in the current context.
Returns false if the namespace or WebExtension environment is absent, or if accessing it throws.
The check is synchronous, does not log, and reads the current API on every call without caching.
It checks namespace presence only; it does not guarantee individual methods, permissions, or a successful operation.
import {isAvailableBrowsingData} from "@addon-core/browser";
if (isAvailableBrowsingData()) {
// The namespace is present; handle operation-specific failures when using it.
}removeBrowsingData(options: chrome.browsingData.RemovalOptions, dataToRemove: chrome.browsingData.DataTypeSet): Promise<void>
Clears the specified types of browsing data within the given time range.
removeAppcacheData(options?: chrome.browsingData.RemovalOptions): Promise<void>
Clears the application cache.
removeCacheData(options?: chrome.browsingData.RemovalOptions): Promise<void>
Clears the browser cache.
removeCacheStorageData(options?: chrome.browsingData.RemovalOptions): Promise<void>
Clears Cache Storage.
removeCookiesData(options?: chrome.browsingData.RemovalOptions): Promise<void>
Clears all cookies.
removeDownloadsData(options?: chrome.browsingData.RemovalOptions): Promise<void>
Clears download history.
removeFileSystemsData(options?: chrome.browsingData.RemovalOptions): Promise<void>
Clears file system data.
removeFormData(options?: chrome.browsingData.RemovalOptions): Promise<void>
Clears data entered into forms.
removeHistoryData(options?: chrome.browsingData.RemovalOptions): Promise<void>
Clears browsing history.
removeIndexedDBData(options?: chrome.browsingData.RemovalOptions): Promise<void>
Clears IndexedDB data.
removeLocalStorageData(options?: chrome.browsingData.RemovalOptions): Promise<void>
Clears Local Storage data.
removePasswordsData(options?: chrome.browsingData.RemovalOptions): Promise<void>
Clears saved passwords.
removeServiceWorkersData(options?: chrome.browsingData.RemovalOptions): Promise<void>
Clears Service Worker registrations.
removeWebSQLData(options?: chrome.browsingData.RemovalOptions): Promise<void>
Clears WebSQL data.
getBrowsingDataSettings(): Promise<chrome.browsingData.SettingsResult>
Retrieves the current browsing data removal settings.