summaryrefslogtreecommitdiffstats
path: root/addon_chrome/ismitmlink/bg.js
diff options
context:
space:
mode:
authorclearnet <clearnet@noreply.codeberg.org>2019-08-12 11:55:09 +0200
committerclearnet <clearnet@noreply.codeberg.org>2019-08-12 11:55:09 +0200
commit48e21486f90a099a29556e588d494ea0892e509e (patch)
tree8dd37a8c2bc0f075626440184781bbe39ef38014 /addon_chrome/ismitmlink/bg.js
parent5a88c642d3f735b287accf142bfb405b80a2609c (diff)
downloadcloudflare-tor-48e21486f90a099a29556e588d494ea0892e509e.tar
cloudflare-tor-48e21486f90a099a29556e588d494ea0892e509e.tar.gz
cloudflare-tor-48e21486f90a099a29556e588d494ea0892e509e.tar.lz
cloudflare-tor-48e21486f90a099a29556e588d494ea0892e509e.tar.xz
cloudflare-tor-48e21486f90a099a29556e588d494ea0892e509e.zip
1.0.14.1 GC
Diffstat (limited to 'addon_chrome/ismitmlink/bg.js')
-rw-r--r--addon_chrome/ismitmlink/bg.js28
1 files changed, 19 insertions, 9 deletions
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')
@@ -59,6 +59,9 @@ function forget_cache_1w() {
'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)
});
chrome.storage.local.set({
@@ -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')
@@ -85,6 +88,9 @@ chrome.storage.local.get(['lastU', 'lastV'], (g) => {
'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')
@@ -108,6 +114,9 @@ chrome.storage.local.get(['lastU', 'lastV'], (g) => {
'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)
});
chrome.storage.local.set({
@@ -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