From 10e680c2ef535d849850635383e14f01609e0399 Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Mon, 13 Feb 2023 12:43:58 -0500 Subject: [PATCH] Output highly generic cosmetic filters --- src/js/cosmetic-filtering.js | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/js/cosmetic-filtering.js b/src/js/cosmetic-filtering.js index 0273e5cde..2cd7ad854 100644 --- a/src/js/cosmetic-filtering.js +++ b/src/js/cosmetic-filtering.js @@ -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'); };