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
.
var removing = browser.browsingData.removeCache(
removalOptions
// RemovalOptions object
)
removalOptions
可选
对象
。
browsingData.RemovalOptions
object. This parameter has no effect.
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.
BCD tables only load in the browser
Clear the browser cache:
function onRemoved() {
console.log("removed");
}
function onError(error) {
console.error(error);
}
browser.browsingData.removeCache({}).
then(onRemoved, onError);
注意:
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.
最后修改: , 由 MDN 贡献者