1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-09-14 23:12:28 +02:00

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.
This commit is contained in:
Raymond Hill 2020-09-09 09:57:29 -04:00
parent 0c90cc6af7
commit d4182add6e
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2

View File

@ -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);
}
}