From 48e21486f90a099a29556e588d494ea0892e509e Mon Sep 17 00:00:00 2001 From: clearnet Date: Mon, 12 Aug 2019 11:55:09 +0200 Subject: 1.0.14.1 GC --- addon_chrome/ismitmlink/bg.js | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) (limited to 'addon_chrome/ismitmlink/bg.js') diff --git a/addon_chrome/ismitmlink/bg.js b/addon_chrome/ismitmlink/bg.js index 0a76ff5a..53f5f638 100644 --- a/addon_chrome/ismitmlink/bg.js +++ b/addon_chrome/ismitmlink/bg.js @@ -46,8 +46,8 @@ function i_already_know_you(f) { }); } -function forget_cache_1w() { - chrome.storage.local.get(['ign1', 'ign2', 'obs'], (g) => { +function forget_cache_2w() { + chrome.storage.local.get(['ign1', 'ign2', 'obs', 'dbg'], (g) => { chrome.storage.local.clear(); chrome.storage.local.set({ 'ign1': (g.ign1 == 'y' ? 'y' : 'n') @@ -58,6 +58,9 @@ function forget_cache_1w() { chrome.storage.local.set({ 'obs': (g.obs == 'y' ? 'y' : 'n') }); + chrome.storage.local.set({ + 'dbg': (g.dbg == 'y' ? 'y' : 'n') + }); chrome.storage.local.set({ 'lastU': Math.round((new Date()).getTime() / 1000) }); @@ -66,14 +69,14 @@ function forget_cache_1w() { }); }); setTimeout(function () { - forget_cache_1w(); - }, 604800000); + forget_cache_2w(); + }, 1209600000); } chrome.storage.local.get(['lastU', 'lastV'], (g) => { if (g.lastU) { - if (Math.abs(Math.round((new Date()).getTime() / 1000) - g.lastU) > 604800) { - chrome.storage.local.get(['ign1', 'ign2', 'obs'], (g) => { + if (Math.abs(Math.round((new Date()).getTime() / 1000) - g.lastU) > 1209600) { + chrome.storage.local.get(['ign1', 'ign2', 'obs', 'dbg'], (g) => { chrome.storage.local.clear(); chrome.storage.local.set({ 'ign1': (g.ign1 == 'y' ? 'y' : 'n') @@ -84,6 +87,9 @@ chrome.storage.local.get(['lastU', 'lastV'], (g) => { chrome.storage.local.set({ 'obs': (g.obs == 'y' ? 'y' : 'n') }); + chrome.storage.local.set({ + 'dbg': (g.dbg == 'y' ? 'y' : 'n') + }); chrome.storage.local.set({ 'lastU': Math.round((new Date()).getTime() / 1000) }); @@ -96,7 +102,7 @@ chrome.storage.local.get(['lastU', 'lastV'], (g) => { } let nowVer = (chrome.runtime.getManifest()).version; if (g.lastV != nowVer) { - chrome.storage.local.get(['ign1', 'ign2', 'obs'], (g) => { + chrome.storage.local.get(['ign1', 'ign2', 'obs', 'dbg'], (g) => { chrome.storage.local.clear(); chrome.storage.local.set({ 'ign1': (g.ign1 == 'y' ? 'y' : 'n') @@ -107,6 +113,9 @@ chrome.storage.local.get(['lastU', 'lastV'], (g) => { chrome.storage.local.set({ 'obs': (g.obs == 'y' ? 'y' : 'n') }); + chrome.storage.local.set({ + 'dbg': (g.dbg == 'y' ? 'y' : 'n') + }); chrome.storage.local.set({ 'lastU': Math.round((new Date()).getTime() / 1000) }); @@ -116,8 +125,8 @@ chrome.storage.local.get(['lastU', 'lastV'], (g) => { }); } setTimeout(function () { - forget_cache_1w(); - }, 604800000); + forget_cache_2w(); + }, 1209600000); }); chrome.runtime.onMessage.addListener((request, sender, sendResponse) => { @@ -138,4 +147,5 @@ chrome.runtime.onMessage.addListener((request, sender, sendResponse) => { } }, () => {}); } + return; }); \ No newline at end of file -- cgit v1.2.3