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(method?: ApiMethodName<typeof chrome.browsingData>): booleanThe optional method is a native function name, for example isAvailableBrowsingData("remove").
Import the public ApiMethodName type from @addon-core/browser for your own typed helpers.
This checks callable presence without invoking the method; permissions and argument support still require handling.
Returns 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.
Without an argument, it checks namespace presence only. Pass a native method name to also check that it is callable.
Neither form verifies permissions, argument support, or a successful operation. See method availability.
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.