browsingData API

Hint

The browsingData API is inherited from Firefox, and its primary documentation is maintained by Mozilla at MDN. Thunderbird implements only the subset of functions, events, and types listed here. The MDN pages may provide further details and examples, but they may also reference features that are not supported in Thunderbird.

Use the chrome.browsingData API to remove browsing data from a user’s local profile.

Permissions

The following permissions influence the behavior of the API. Depending on which permissions are requested, additional methods might be available, or certain data may be included in responses.

Hint

Request permissions only when needed. Unnecessary requests may result in rejection during ATN review.

browsingData

browsingData

Clear recent browsing history, cookies, and related data.

Note

The permission browsingData is required to use messenger.browsingData.*.

Functions

remove(options, dataToRemove)

– [Added in TB 53]

Clears various types of browsing data stored in a user’s profile.

Note

Specifying dataTypes.history will also remove download history and service workers.

Parameters

options

options

dataToRemove

dataToRemove

The set of data types to remove.

Required permissions

  • browsingData

removeAppcache(options)

Clears websites’ appcache data.

Parameters

options

options

Required permissions

  • browsingData

removeCache(options)

– [Added in TB 53]

Clears the browser’s cache.

Note

removalOptions.since is not supported.

Parameters

options

options

Required permissions

  • browsingData

removeCookies(options)

– [Added in TB 53]

Clears the browser’s cookies and server-bound certificates modified within a particular timeframe.

Parameters

options

options

Required permissions

  • browsingData

removeDownloads(options)

– [Added in TB 53]

Clears the browser’s list of downloaded files (not the downloaded files themselves).

Parameters

options

options

Required permissions

  • browsingData

removeFileSystems(options)

Clears websites’ file system data.

Parameters

options

options

Required permissions

  • browsingData

removeFormData(options)

– [Added in TB 53]

Clears the browser’s stored form data (autofill).

Parameters

options

options

Required permissions

  • browsingData

removeHistory(options)

– [Added in TB 53]

Clears the browser’s history.

Note

This function also removes download history and service workers.

Parameters

options

options

Required permissions

  • browsingData

removeIndexedDB(options)

Clears websites’ IndexedDB data.

Parameters

options

options

Required permissions

  • browsingData

removeLocalStorage(options)

– [Added in TB 57]

Clears websites’ local storage data.

Note

removalOptions.since is not supported.

Parameters

options

options

Required permissions

  • browsingData

removePasswords(options)

– [Added in TB 53]

Clears the browser’s stored passwords.

Parameters

options

options

Required permissions

  • browsingData

removePluginData(options)

– [Added in TB 53]

Clears plugins’ data.

Parameters

options

options

Required permissions

  • browsingData

removeWebSQL(options)

Clears websites’ WebSQL data.

Parameters

options

options

Required permissions

  • browsingData

settings()

– [Added in TB 53]

Reports which types of data are currently selected in the ‘Clear browsing data’ settings UI. Note: some of the data types included in this API are not available in the settings UI, and some UI settings control more than one data type listed here.

Return type (Promise)

_returns

object

dataRemovalPermitted

dataRemovalPermitted

All of the types will be present in the result, with values of true if they are permitted to be removed (e.g., by enterprise policy) and false if not.

dataToRemove

dataToRemove

All of the types will be present in the result, with values of true if they are both selected to be removed and permitted to be removed, otherwise false.

options

options

Required permissions

  • browsingData

Types

DataTypeSet

A set of data types. Missing data types are interpreted as false.

object

cache

[cache]

(boolean, optional)

The browser’s cache. Note: when removing data, this clears the entire cache: it is not limited to the range you specify.

cookies

[cookies]

(boolean, optional)

The browser’s cookies.

downloads

[downloads]

(boolean, optional)

The browser’s download list.

formData

[formData]

(boolean, optional)

The browser’s stored form data.

history

[history]

(boolean, optional)

The browser’s history.

indexedDB

[indexedDB]

(boolean, optional)

– [Added in TB 57]

Websites’ IndexedDB data.

localStorage

[localStorage]

(boolean, optional)

– [Added in TB 57]

Websites’ local storage data.

passwords

[passwords]

(boolean, optional)

Stored passwords.

pluginData

[pluginData]

(boolean, optional)

Plugins’ data.

serverBoundCertificates

[serverBoundCertificates]

(boolean, optional)

Server-bound certificates.

serviceWorkers

[serviceWorkers]

(boolean, optional)

Service Workers.

RemovalOptions

Options that determine exactly what data will be removed.

object

cookieStoreId

[cookieStoreId]

(string, optional)

– [Added in TB 84]

Only remove data associated with this specific cookieStoreId.

hostnames

[hostnames]

(array of string, optional)

– [Added in TB 56]

Only remove data associated with these hostnames (only applies to cookies and localStorage).

Note

From Thunderbird 56 supports the specification of hostnames for the deletion of cookies and local storage items.

Note

From Thunderbird 77 also supports the specification of hostnames for the deletion of service worker and indexedDB items.

originTypes

[originTypes]

(object, optional)

An object whose properties specify which origin types ought to be cleared. If this object isn’t specified, it defaults to clearing only “unprotected” origins. Please ensure that you really want to remove application data before adding ‘protectedWeb’ or ‘extensions’.

extension

[extension]

(boolean, optional)

Extensions and packaged applications a user has installed (be _really_ careful!).

protectedWeb

[protectedWeb]

(boolean, optional)

Websites that have been installed as hosted applications (be careful!).

unprotectedWeb

[unprotectedWeb]

(boolean, optional)

Normal websites.

since

[since]

(Date, optional)

Remove data accumulated on or after this date, represented in milliseconds since the epoch (accessible via the getTime method of the JavaScript Date object). If absent, defaults to 0 (which would remove all browsing data).

Note

since is not supported with the following data types: cache, indexedDB, localStorage, and serviceWorkers.