browsingData.removeCache()
Clears the browser's cache.
Note that although this function can take a browsingData.RemovalOptions
object, it will be ignored. The entire cache is always cleared when using this function.
This is an asynchronous function that returns a Promise
.
Syntax
var removing = browser.browsingData.removeCache(
removalOptions // RemovalOptions object
)
Parameters
removalOptions
Optionalobject
. AbrowsingData.RemovalOptions
object. This parameter 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.
Browser compatibility
Report problems with this compatibility data on GitHubwebextensions-desktop | webextensions-mobile | |||||
---|---|---|---|---|---|---|
removeCache | ChromeFull supportYes | EdgeFull support79 | FirefoxFull support53
| OperaFull supportYes | SafariNo supportNo | Firefox for AndroidNo support57 — 79
|
Legend
- Full support
- Full support
- No support
- No support
- See implementation notes.
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.
Examples
Clear the browser cache:
function onRemoved() {
console.log("removed");
}
function onError(error) {
console.error(error);
}
browser.browsingData.removeCache({}).
then(onRemoved, onError);
Acknowledgements
This API is based on Chromium's chrome.browsingData
API.
Microsoft Edge compatibility data is supplied by Microsoft Corporation and is included here under the Creative Commons Attribution 3.0 United States License.