browsingData.removeCache()
Clears the browser's cache.
Note that this function requires a browsingData.RemovalOptions
object, but all options are ignored. The entire cache is always cleared when using this function.
This is an asynchronous function that returns a Promise
.
Syntax
js
let removing = browser.browsingData.removeCache(
removalOptions // RemovalOptions object
)
Parameters
removalOptions
-
object
. AbrowsingData.RemovalOptions
object. This parameter must be set but has no effect.
Return value
A Promise
that will be fulfilled with no arguments when the removal has finished. If any error occurs, the promise will be rejected with an error message.
Examples
Clear the browser cache:
js
function onRemoved() {
console.log("removed");
}
function onError(error) {
console.error(error);
}
browser.browsingData.removeCache({}).then(onRemoved, onError);
Browser compatibility
Report problems with this compatibility data on GitHubdesktop | mobile | ||||||
---|---|---|---|---|---|---|---|
removeCache |
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.
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
Note:
This API is based on Chromium's chrome.browsingData
API.