Skip to content

Latest commit

 

History

History
197 lines (126 loc) · 4.51 KB

browsing-data.md

File metadata and controls

197 lines (126 loc) · 4.51 KB

browsingData

Documentation: Chrome Browsing Data API

A promise-based wrapper for the Chrome browsingData API.

Methods


isAvailableBrowsingData

isAvailableBrowsingData(): boolean

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

removeBrowsingData(options: chrome.browsingData.RemovalOptions, dataToRemove: chrome.browsingData.DataTypeSet): Promise<void>

Clears the specified types of browsing data within the given time range.

removeAppcacheData

removeAppcacheData(options?: chrome.browsingData.RemovalOptions): Promise<void>

Clears the application cache.

removeCacheData

removeCacheData(options?: chrome.browsingData.RemovalOptions): Promise<void>

Clears the browser cache.

removeCacheStorageData

removeCacheStorageData(options?: chrome.browsingData.RemovalOptions): Promise<void>

Clears Cache Storage.

removeCookiesData

removeCookiesData(options?: chrome.browsingData.RemovalOptions): Promise<void>

Clears all cookies.

removeDownloadsData

removeDownloadsData(options?: chrome.browsingData.RemovalOptions): Promise<void>

Clears download history.

removeFileSystemsData

removeFileSystemsData(options?: chrome.browsingData.RemovalOptions): Promise<void>

Clears file system data.

removeFormData

removeFormData(options?: chrome.browsingData.RemovalOptions): Promise<void>

Clears data entered into forms.

removeHistoryData

removeHistoryData(options?: chrome.browsingData.RemovalOptions): Promise<void>

Clears browsing history.

removeIndexedDBData

removeIndexedDBData(options?: chrome.browsingData.RemovalOptions): Promise<void>

Clears IndexedDB data.

removeLocalStorageData

removeLocalStorageData(options?: chrome.browsingData.RemovalOptions): Promise<void>

Clears Local Storage data.

removePasswordsData

removePasswordsData(options?: chrome.browsingData.RemovalOptions): Promise<void>

Clears saved passwords.

removeServiceWorkersData

removeServiceWorkersData(options?: chrome.browsingData.RemovalOptions): Promise<void>

Clears Service Worker registrations.

removeWebSQLData

removeWebSQLData(options?: chrome.browsingData.RemovalOptions): Promise<void>

Clears WebSQL data.

getBrowsingDataSettings

getBrowsingDataSettings(): Promise<chrome.browsingData.SettingsResult>

Retrieves the current browsing data removal settings.