chrome扩展清除指定站点缓存chrome.browsingData.remove
案例
// 注意仅支持在后台运行
chrome.browsingData.remove({
since: Date.now() - 1000 * 60 * 60 * 24 * 7, // 整个浏览最近7天的
origins: ["http://www.xxx.com"], // 如果设置了origins则仅对这里的地址,否则则所有站点
}, {
"appcache": true,
"cache": true,
"cacheStorage": true,
"cookies": true,
// "downloads": true,
// "fileSystems": true,
// "formData": true,
// "history": true,
"indexedDB": true,
"localStorage": true,
// "passwords": true,
"serviceWorkers": true,
"webSQL": true
}, () => {
console.log('清除完成')
})
参考资料
原文地址:https://blog.csdn.net/qq_35606400/article/details/140461938
免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!