From 6e31f8011b710eca485ea292ef2d8dc1869b410c Mon Sep 17 00:00:00 2001 From: gorhill Date: Sat, 7 Feb 2015 08:34:11 -0500 Subject: [PATCH] this fixes #719 --- src/js/static-net-filtering.js | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/src/js/static-net-filtering.js b/src/js/static-net-filtering.js index 1c6d32f83..8f837124b 100644 --- a/src/js/static-net-filtering.js +++ b/src/js/static-net-filtering.js @@ -1825,6 +1825,7 @@ FilterContainer.prototype.addHostnameOnlyFilter = function(parsed) { return false; } + var isNewFilter = false; var party = AnyParty; if ( parsed.firstParty !== parsed.thirdParty ) { party = parsed.firstParty ? FirstParty : ThirdParty; @@ -1844,19 +1845,23 @@ FilterContainer.prototype.addHostnameOnlyFilter = function(parsed) { bucket['.'] = new FilterHostnameDict(); } if ( bucket['.'].add(parsed.f) ) { - if ( parsed.action ) { - this.allowFilterCount += 1; - } else { - this.blockFilterCount += 1; - } - } else { - this.duplicateCount++; + isNewFilter = true; } } bitOffset += 1; type >>>= 1; } - + // https://github.com/gorhill/uBlock/issues/719 + // Count whole filter, not its decomposed versions + if ( isNewFilter ) { + if ( parsed.action ) { + this.allowFilterCount += 1; + } else { + this.blockFilterCount += 1; + } + } else { + this.duplicateCount += 1; + } return true; };