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
Clear recent browsing history, cookies, and related data.
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
dataToRemove
The set of data types to remove.
Required permissions
removeAppcache(options)
Clears websites’ appcache data.
Required permissions
removeCache(options)
– [Added in TB 53]
Clears the browser’s cache.
Note
removalOptions.since is not supported.
Required permissions
Clears the browser’s cookies and server-bound certificates modified within a particular timeframe.
Required permissions
removeDownloads(options)
– [Added in TB 53]
Clears the browser’s list of downloaded files (not the downloaded files themselves).
Required permissions
removeFileSystems(options)
Clears websites’ file system data.
Required permissions
removeFormData(options)
– [Added in TB 53]
Clears the browser’s stored form data (autofill).
Required permissions
removeHistory(options)
– [Added in TB 53]
Clears the browser’s history.
Note
This function also removes download history and service workers.
Required permissions
removeIndexedDB(options)
Clears websites’ IndexedDB data.
Required permissions
removeLocalStorage(options)
– [Added in TB 57]
Clears websites’ local storage data.
Note
removalOptions.since is not supported.
Required permissions
removePasswords(options)
– [Added in TB 53]
Clears the browser’s stored passwords.
Required permissions
removePluginData(options)
– [Added in TB 53]
Clears plugins’ data.
Required permissions
removeWebSQL(options)
Clears websites’ WebSQL data.
Required permissions
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
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
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
Required permissions
Types
DataTypeSet
A set of data types. Missing data types are interpreted as false.
object
cache
The browser’s cache. Note: when removing data, this clears the entire cache: it is not limited to the range you specify.
cookies
The browser’s cookies.
downloads
The browser’s download list.
formData
The browser’s stored form data.
history
The browser’s history.
indexedDB
Websites’ IndexedDB data.
localStorage
Websites’ local storage data.
passwords
Stored passwords.
pluginData
Plugins’ data.
serverBoundCertificates
Server-bound certificates.
serviceWorkers
Service Workers.
RemovalOptions
Options that determine exactly what data will be removed.
object
cookieStoreId
Only remove data associated with this specific cookieStoreId.
hostnames
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
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
Extensions and packaged applications a user has installed (be _really_ careful!).
protectedWeb
Websites that have been installed as hosted applications (be careful!).
unprotectedWeb
Normal websites.
since
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.