mirror of
https://gitlab.com/KevinRoebert/ClearUrls
synced 2025-12-15 21:55:36 +07:00
Version 1.9.0
- Added #284 - Added #56 - Fixed #241 - Possible fix & workaround for #203 - Fixed bug in "history tracking injection protection". This option was not disabled, when the global filter switch are on off - Added an option to im-/export the log (requires the `downloads` permission) - Added an option to im-/export the settings (requires the `downloads` permission) - Added information page for blocked sites, when they are called in the `main_frame` - Added "multiple times URL encodes" recognition - Refactoring - Changed background script loading sequence to prevent that required functions are not yet loaded.
This commit is contained in:
38
core_js/watchdog.js
Normal file
38
core_js/watchdog.js
Normal file
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
* ClearURLs
|
||||
* Copyright (c) 2017-2019 Kevin Röbert
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*jshint esversion: 6 */
|
||||
/*
|
||||
* This script is responsible to check in fixed intervals, that ClearURLs works properly.
|
||||
* In issue #203, some users reported, that ClearURLs filter function doesn't work after
|
||||
* some time, but without any recognizable reason.
|
||||
*
|
||||
* This watchdog restarts the whole Add-on, when the check fails.
|
||||
*/
|
||||
const CHECK_INTERVAL = 15000;
|
||||
|
||||
setInterval(function() {
|
||||
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();
|
||||
}
|
||||
}, CHECK_INTERVAL);
|
||||
Reference in New Issue
Block a user