browsingData API
Use the chrome.browsingData API to remove browsing data from a user’s local profile.
Permissions
Clear recent browsing history, cookies, and related data
Functions
remove(options, dataToRemove)
Clears various types of browsing data stored in a user’s profile.
Required permissions
removeAppcache(options)
Clears websites’ appcache data.
Parameters
Required permissions
removeCache(options)
Clears the browser’s cache.
Parameters
Required permissions
Clears the browser’s cookies and server-bound certificates modified within a particular timeframe.
Parameters
Required permissions
removeDownloads(options)
Clears the browser’s list of downloaded files (not the downloaded files themselves).
Parameters
Required permissions
removeFileSystems(options)
Clears websites’ file system data.
Parameters
Required permissions
removeFormData(options)
Clears the browser’s stored form data (autofill).
Parameters
Required permissions
removeHistory(options)
Clears the browser’s history.
Parameters
Required permissions
removeIndexedDB(options)
Clears websites’ IndexedDB data.
Parameters
Required permissions
removeLocalStorage(options)
Clears websites’ local storage data.
Parameters
Required permissions
removePasswords(options)
Clears the browser’s stored passwords.
Parameters
Required permissions
removePluginData(options)
Clears plugins’ data.
Parameters
Required permissions
removeWebSQL(options)
Clears websites’ WebSQL data.
Parameters
Required permissions
settings()
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)
object
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.
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.
Required permissions
Types
DataTypeSet
A set of data types. Missing data types are interpreted as false.
object
[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
]
(boolean, optional)
The browser’s cookies.
[downloads
]
(boolean, optional)
The browser’s download list.
[formData
]
(boolean, optional)
The browser’s stored form data.
[history
]
(boolean, optional)
The browser’s history.
[indexedDB
]
(boolean, optional)
Websites’ IndexedDB data.
[localStorage
]
(boolean, optional)
Websites’ local storage data.
[passwords
]
(boolean, optional)
Stored passwords.
[pluginData
]
(boolean, optional)
Plugins’ data.
[serverBoundCertificates
]
(boolean, optional)
Server-bound certificates.
[serviceWorkers
]
(boolean, optional)
Service Workers.
RemovalOptions
Options that determine exactly what data will be removed.
object
[cookieStoreId
]
(string, optional)
Only remove data associated with this specific cookieStoreId.
[hostnames
]
(array of string, optional)
Only remove data associated with these hostnames (only applies to cookies and localStorage).
[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
]
(boolean, optional)
Extensions and packaged applications a user has installed (be _really_ careful!).
[protectedWeb
]
(boolean, optional)
Websites that have been installed as hosted applications (be careful!).
[unprotectedWeb
]
(boolean, optional)
Normal websites.
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).