diff options
author | Alessio Vanni <vannilla@firemail.cc> | 2019-03-02 15:53:13 +0100 |
---|---|---|
committer | Alessio Vanni <vannilla@firemail.cc> | 2019-03-02 15:53:13 +0100 |
commit | d60b478b8eadf539a2657074cbd86d02221b707b (patch) | |
tree | bad786adfb1b708a942960fb8308e872c9ec77ae /js/pagestats.js | |
parent | 760510a7b976917911cd47c3ec25b56a790b86de (diff) | |
download | ematrix-d60b478b8eadf539a2657074cbd86d02221b707b.tar.lz ematrix-d60b478b8eadf539a2657074cbd86d02221b707b.tar.xz ematrix-d60b478b8eadf539a2657074cbd86d02221b707b.zip |
Change from distinct requests to blocked requests
Ported from uMatrix.
I agree that the number of blocked requests is more useful than the
number of distinct requests.
Diffstat (limited to 'js/pagestats.js')
-rw-r--r-- | js/pagestats.js | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/js/pagestats.js b/js/pagestats.js index a6526e6..0a95396 100644 --- a/js/pagestats.js +++ b/js/pagestats.js @@ -206,6 +206,12 @@ PageStore.prototype = { }, recordRequest: function(type, url, block) { + if ( block !== false ) { + this.perLoadBlockedRequestCount++; + } else { + this.perLoadAllowedRequestCount++; + } + // Store distinct network requests. This is used to: // - remember which hostname/type were seen // - count the number of distinct URLs for any given @@ -230,13 +236,7 @@ PageStore.prototype = { ηm.requestStats.record(type, block); ηm.updateBadgeAsync(this.tabId); - if ( block !== false ) { - this.perLoadBlockedRequestCount++; - } else { - this.perLoadAllowedRequestCount++; - } - - this.distinctRequestCount++; + // this.distinctRequestCount++; this.mtxCountModifiedTime = Date.now(); if ( this.domains.has(hostname) === false ) { |