1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-11-07 03:12:33 +01:00

Output highly generic cosmetic filters

This commit is contained in:
Raymond Hill 2023-02-13 12:43:58 -05:00
parent 426bf2d170
commit 10e680c2ef
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2

View File

@ -965,16 +965,22 @@ FilterContainer.prototype.getFilterCount = function() {
/******************************************************************************/
FilterContainer.prototype.dump = function() {
const generics = [];
const lowlyGenerics = [];
for ( const selectors of this.lowlyGeneric.values() ) {
generics.push(...selectors.split(',\n'));
lowlyGenerics.push(...selectors.split(',\n'));
}
lowlyGenerics.sort();
const highlyGenerics = Array.from(this.highlyGeneric.simple.dict);
highlyGenerics.push(Array.from(this.highlyGeneric.complex.dict));
highlyGenerics.sort();
return [
'Cosmetic Filtering Engine internals:',
`specific: ${this.specificFilters.size}`,
`generic: ${generics.length}`,
`+ selectors: ${this.lowlyGeneric.size}`,
...generics.map(a => ` ${a}`),
`generic: ${lowlyGenerics.length + highlyGenerics.length}`,
`+ lowly generic: ${lowlyGenerics.length}`,
...lowlyGenerics.map(a => ` ${a}`),
`+ highly generic: ${highlyGenerics.length}`,
...highlyGenerics.map(a => ` ${a}`),
].join('\n');
};