chrome扩展清除指定站点缓存chrome.browsingData.remove

案例

js 复制代码
// 注意仅支持在后台运行
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('清除完成')
})

参考资料

相关推荐
街尾杂货店&33 分钟前
css word-spacing属性
前端·css
千叶寻-36 分钟前
正则表达式
前端·javascript·后端·架构·正则表达式·node.js
心勤则明2 小时前
Spring AI 会话记忆实战:从内存存储到 MySQL + Redis 双层缓存架构
人工智能·spring·缓存
光影少年6 小时前
angular生态及学习路线
前端·学习·angular.js
无尽夏_8 小时前
HTML5(前端基础)
前端·html·html5
Jagger_8 小时前
敏捷开发流程-精简版
前端·后端
FIN66688 小时前
昂瑞微冲刺科创板:创新驱动,引领射频芯片国产化新征程
前端·安全·前端框架·信息与通信·芯片
GISer_Jing8 小时前
ByteDance——jy真题
前端·javascript·面试
睡美人的小仙女1278 小时前
浏览器为何屏蔽本地文件路径?
前端
真的想不出名儿8 小时前
Vue 中 props 传递数据的坑
前端·javascript·vue.js