browsingData.RemovalOptions

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

Type

Values of this type are objects. They contain the following properties:

hostnames Optional

Array of string. This property only applies to cookies and local storage items. Only remove cookies and local storage items which are 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 just the hostname. Items associated with subdomains of a given hostname will not be removed: you must explicitly list subdomains.

originTypes Optional

object. Used to control whether to remove data only from normal web pages, or also from hosted web apps and 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.
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

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxOperaFirefox for Android
hostnamesChrome No support NoEdge No support NoFirefox Full support 56Opera No support NoFirefox Android No support No
originTypesChrome Full support YesEdge No support NoFirefox No support NoOpera Full support YesFirefox Android No support No
originTypes.extensionChrome Full support YesEdge No support NoFirefox No support NoOpera Full support YesFirefox Android No support No
originTypes.protectedWebChrome Full support YesEdge No support NoFirefox No support NoOpera Full support YesFirefox Android No support No
sinceChrome Full support YesEdge No support NoFirefox Full support 53
Notes
Full support 53
Notes
Notes since is not supported with the following data types: cache, indexedDB, localStorage, and serviceWorkers.
Opera Full support YesFirefox Android Full support 56
Notes
Full support 56
Notes
Notes since is not supported with the following data types: cache, indexedDB, localStorage, and serviceWorkers.

Legend

Full support  
Full support
No support  
No support
See implementation notes.
See implementation notes.

Acknowledgements

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

Document Tags and Contributors

Contributors to this page: ExE-Boss, wbamberg, andrewtruongmoz
Last updated by: ExE-Boss,