From d4182add6e4e5d61368720115088e886f4851c0c Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Wed, 9 Sep 2020 09:57:29 -0400 Subject: [PATCH] Add ability to outright remove/ignore "really bad lists" In addition to what is deemed really bad lists by consensus, some lists will also be labelled "really bad list" temporarily so as to force-remove them from the set of filter lists. This will be the case for filter lists which are not necessarily "bad lists" but which were once part of uBO's stock filter lists and have been removed since then for various reasons. This will ensure that the majority of users who do not modifies uBO's default listset will still have a configuration which matches the official default listset. --- src/js/storage.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/js/storage.js b/src/js/storage.js index 17f7e2a7b..3bbfaf103 100644 --- a/src/js/storage.js +++ b/src/js/storage.js @@ -339,7 +339,7 @@ self.addEventListener('hiddenSettingsChanged', ( ) => { const result = Array.from(selectedListKeySet); if ( externalLists !== this.userSettings.externalLists ) { this.userSettings.externalLists = externalLists; - vAPI.storage.set({ externalLists: externalLists }); + vAPI.storage.set({ externalLists }); } this.saveSelectedFilterLists(result); }; @@ -354,6 +354,8 @@ self.addEventListener('hiddenSettingsChanged', ( ) => { while ( lineIter.eot() === false ) { const location = lineIter.next().trim(); if ( reIgnore.test(location) || !reValid.test(location) ) { continue; } + // Ignore really bad lists. + if ( this.badLists.get(location) === true ) { continue; } out.add(location); } return Array.from(out); @@ -543,8 +545,8 @@ self.addEventListener('hiddenSettingsChanged', ( ) => { for ( const line of badlists.content.split(/\s*[\n\r]+\s*/) ) { if ( line === '' || line.startsWith('#') ) { continue; } const fields = line.split(/\s+/); - const nofetch = fields.length === 2 && fields[1] === 'nofetch'; - this.badLists.set(fields[0], nofetch); + const remove = fields.length === 2; + this.badLists.set(fields[0], remove); } }