Version 1.16.0

#362
#440
#429
#428
#431
This commit is contained in:
Kevin Röbert
2020-03-20 01:50:22 +01:00
parent b1a5b5fcb0
commit 0298792aa1
18 changed files with 299 additions and 163 deletions

View File

@@ -24,15 +24,21 @@
*
* This watchdog restarts the whole Add-on, when the check fails.
*/
const CHECK_INTERVAL = 15000;
const CHECK_INTERVAL = 60000;
setInterval(function() {
const dirtyURL = "https://clearurls.roebert.eu?utm_source=addon";
const cleanURL = "https://clearurls.roebert.eu";
if(isStorageAvailable() && storage.globalStatus) {
const dirtyURL = "https://clearurls.roebert.eu?utm_source=addon";
const cleanURL = "https://clearurls.roebert.eu";
if(pureCleaning(dirtyURL, true) !== cleanURL) {
console.log(translate('watchdog'));
saveOnExit();
reload();
if(pureCleaning(dirtyURL, true) !== cleanURL) {
storage.watchDogErrorCount += 1;
console.log(translate('watchdog', storage.watchDogErrorCount));
saveOnExit();
if(storage.watchDogErrorCount < 3) reload();
} else if(storage.watchDogErrorCount > 0){
storage.watchDogErrorCount = 0;
saveOnExit();
}
}
}, CHECK_INTERVAL);