browsingData.RemovalOptions

The browsingData.RemovalOptions type contains options to control browsing data removal.

Type

Values of this type are objects. They contain these properties:

cookieStoreId Optional

string. This property only applies to cookies, indexedDB, and local storage (localStorage) items. The removal is limited to items belonging to a specific cookie store as specified by the ID. See Work with contextual identities for more information.

excludeOrigin Optional

array of string. List of origins to exclude from the removal process. Can't be used together with origins. Only supported for cookies, storage, and cache. Cookies are excluded for the entire registrable domain.

hostnames Optional

array of string. This property applies to cookie, indexedDB, local storage, and service worker registration items. Remove only cookie, indexedDB, local storage, and service worker registration items associated with these hostnames.

You must pass in just a hostname here, without protocol (for example, "google.com" not "https://google.com"). You can use the URL interface to parse a raw URL and retrieve the hostname. Items associated with subdomains of a given hostname are not removed: you must explicitly list subdomains.

origin Optional

array of string. List of origins to remove data for. Can't be used together with excludeOrigins. Only supported for cookies, storage, and cache. Cookies are cleared for the entire registrable domain.

originTypes Optional

object. Used to control whether to remove data only from normal web pages, or also from extensions. If this option is omitted, only data from normal web pages (unprotectedWeb) is removed. Before removing data from web apps or extensions, be very careful to ensure that this is really what the user wants.

This object may contain any of the following properties:

unprotectedWeb Optional

boolean. If present and true, remove data from normal web pages.

protectedWeb Optional

boolean. If present and true, remove data from websites that have been installed as hosted apps. (This option is redundant, as hosted web apps are no longer supported.)

extension Optional

boolean. If present and true, remove data from extensions.

since Optional

number. How far back in time to remove data, given in milliseconds since the UNIX epoch. Note that when removing the browser cache, the entire cache is always removed and this option is ignored. If the since property is omitted, it defaults to 0, which means "forever".

Browser compatibility

desktop mobile
Chrome
Edge
Firefox
Opera
Safari
Firefox for Android
Safari on iOS
RemovalOptions
Chrome – Full support
Chrome 19 (Release date: 2012-05-15)
footnote Full support
Edge – Full support
Edge 79 (Release date: 2020-01-15)
footnote Full support
Firefox – Full support
Firefox 53 (Release date: 2017-04-19)
footnote Full support
Opera – Full support
Opera 15 (Release date: 2013-07-02)
footnote Full support
Safari – No support
Safari
footnote No support
Firefox for Android – No support
Firefox for Android 56 – 68 (Release date: 2017-09-28)
footnote Removed in 79 and later
Firefox for Android – Full support
Firefox for Android 84 (Release date: 2020-12-15)
footnote Full support
Safari on iOS – No support
Safari on iOS
footnote No support
cookieStoreId
Chrome – No support
Chrome
footnote No support
Edge – No support
Edge
footnote No support
Firefox – Full support
Firefox 84 (Release date: 2020-12-15)
footnote Full support
Opera – No support
Opera
footnote No support
Safari – No support
Safari
footnote No support
Firefox for Android – Full support
Firefox for Android 84 (Release date: 2020-12-15)
footnote
footnote This option is currently limited to the firefox-default and firefox-private values.
Safari on iOS – No support
Safari on iOS
footnote No support
excludeOrigin
Chrome – Full support
Chrome 74 (Release date: 2019-04-23)
footnote Full support
Edge – Full support
Edge 79 (Release date: 2020-01-15)
footnote Full support
Firefox – No support
Firefox
footnote No support
Opera – Full support
Opera 62 (Release date: 2019-06-27)
footnote Full support
Safari – No support
Safari
footnote No support
Firefox for Android – No support
Firefox for Android
footnote No support
Safari on iOS – No support
Safari on iOS
footnote No support
hostnames
Chrome – No support
Chrome
footnote No support
Edge – No support
Edge
footnote No support
Firefox – Full support
Firefox 56 (Release date: 2017-09-28)
footnote
footnote From Firefox 56 supports the specification of hostnames for the deletion of cookies and local storage items.
footnote From Firefox 77 also supports the specification of hostnames for the deletion of service worker and indexedDB items.
Opera – No support
Opera
footnote No support
Safari – No support
Safari
footnote No support
Firefox for Android – Full support
Firefox for Android 85 (Release date: 2021-01-26)
footnote Full support
Safari on iOS – No support
Safari on iOS
footnote No support
origin
Chrome – Full support
Chrome 74 (Release date: 2019-04-23)
footnote Full support
Edge – Full support
Edge 79 (Release date: 2020-01-15)
footnote Full support
Firefox – No support
Firefox
footnote No support
Opera – Full support
Opera 62 (Release date: 2019-06-27)
footnote Full support
Safari – No support
Safari
footnote No support
Firefox for Android – No support
Firefox for Android
footnote No support
Safari on iOS – No support
Safari on iOS
footnote No support
originTypes
Chrome – Full support
Chrome 21 (Release date: 2012-07-31)
footnote Full support
Edge – Full support
Edge 79 (Release date: 2020-01-15)
footnote Full support
Firefox – No support
Firefox
footnote No support
Opera – Full support
Opera 15 (Release date: 2013-07-02)
footnote Full support
Safari – No support
Safari
footnote No support
Firefox for Android – No support
Firefox for Android
footnote No support
Safari on iOS – No support
Safari on iOS
footnote No support
originTypes.extension
Chrome – Full support
Chrome 21 (Release date: 2012-07-31)
footnote Full support
Edge – Full support
Edge 79 (Release date: 2020-01-15)
footnote Full support
Firefox – No support
Firefox
footnote No support
Opera – Full support
Opera 15 (Release date: 2013-07-02)
footnote Full support
Safari – No support
Safari
footnote No support
Firefox for Android – No support
Firefox for Android
footnote No support
Safari on iOS – No support
Safari on iOS
footnote No support
originTypes.protectedWeb
Chrome – Full support
Chrome 21 (Release date: 2012-07-31)
footnote Full support
Edge – Full support
Edge 79 (Release date: 2020-01-15)
footnote Full support
Firefox – No support
Firefox
footnote No support
Opera – Full support
Opera 15 (Release date: 2013-07-02)
footnote Full support
Safari – No support
Safari
footnote No support
Firefox for Android – No support
Firefox for Android
footnote No support
Safari on iOS – No support
Safari on iOS
footnote No support
since
Chrome – Full support
Chrome 19 (Release date: 2012-05-15)
footnote Full support
Edge – Full support
Edge 79 (Release date: 2020-01-15)
footnote Full support
Firefox – Full support
Firefox 53 (Release date: 2017-04-19)
footnote
footnote since is not supported with the following data types: cache, indexedDB, localStorage, and serviceWorkers.
Opera – Full support
Opera 15 (Release date: 2013-07-02)
footnote Full support
Safari – No support
Safari
footnote No support
Firefox for Android – No support
Firefox for Android 56 – 68 (Release date: 2017-09-28)
footnote Removed in 79 and later
footnote since is not supported with the following data types: cache, indexedDB, localStorage, and serviceWorkers.
Firefox for Android – Full support
Firefox for Android 85 (Release date: 2021-01-26)
footnote
footnote since is not supported with the following data types: cache, indexedDB, localStorage, and serviceWorkers.
Safari on iOS – No support
Safari on iOS
footnote No support

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support
See implementation notes.
Has more compatibility info.

Note: This API is based on Chromium's chrome.browsingData API.