我正在尝试创建一个Chrome扩展程序,以在每次加载或重新加载网站时清除所有历史记录。
下面是如何从一周前删除数据,但是我一直都该怎么做?
var millisecondsPerWeek = 1000 * 60 * 60 * 24 * 7;
var oneWeekAgo = (new Date()).getTime() - millisecondsPerWeek;
chrome.browsingData.remove({
"since": oneWeekAgo
}, {
"appcache": true,
"cache": true,
"cacheStorage": true,
"cookies": true,
"downloads": true,
"fileSystems": true,
"formData": true,
"history": true,
"indexedDB": true,
"localStorage": true,
"pluginData": true,
"passwords": true,
"serviceWorkers": true,
"webSQL": true
}, callback);
此外,我不确定如何在网站加载或重新加载时实施……...这就是我所拥有的
chrome.tabs.onUpdated.addListener( function (tabId, changeInfo, tab) {
if (changeInfo.status == 'complete')