From 891ec7fc26bf0acb1d3fb8acd5a1a676dae87ab2 Mon Sep 17 00:00:00 2001 From: gorhill Date: Thu, 3 Jul 2014 08:28:15 -0400 Subject: [PATCH] do not use memory which is not needed --- js/pagestore.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/js/pagestore.js b/js/pagestore.js index b574abfe1..fd94d9f16 100644 --- a/js/pagestore.js +++ b/js/pagestore.js @@ -112,9 +112,16 @@ PageStore.prototype.recordRequest = function(type, url, reason) { // https://github.com/gorhill/uBlock/issues/7 // https://github.com/gorhill/uBlock/issues/12 - this.blockedRequests[url] = µb.userSettings.logBlockedRequests ? - type + '\t' + reason : - true; + + // No need to record blocked requests which are not image or frame, as + // these are the only ones we try to hide when they are blocked. + if ( µb.userSettings.logBlockedRequests === false ) { + if ( type === 'image' || type === 'sub_frame' ) { + this.blockedRequests[url] = true; + } + return; + } + this.blockedRequests[url] = type + '\t' + reason; }; /******************************************************************************/