Skip to content

Commit

Permalink
Output highly generic cosmetic filters
Browse files Browse the repository at this point in the history
  • Loading branch information
gorhill committed Feb 13, 2023
1 parent 426bf2d commit 10e680c
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/js/cosmetic-filtering.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
};

Expand Down

0 comments on commit 10e680c

Please sign in to comment.