From 11302c629002b8101a470bf561d3bf78a93b12d5 Mon Sep 17 00:00:00 2001 From: gorhill Date: Tue, 29 Jul 2014 21:10:00 -0400 Subject: [PATCH] code review re. #116 --- js/abp-filters.js | 11 ++++------- js/traffic.js | 2 +- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/js/abp-filters.js b/js/abp-filters.js index cf1999ed5..e0f47451e 100644 --- a/js/abp-filters.js +++ b/js/abp-filters.js @@ -1373,6 +1373,10 @@ FilterContainer.prototype.match3rdPartyHostname = function(requestHostname) { // Specialized handlers +// https://github.com/gorhill/uBlock/issues/116 +// Some type of requests are exceptional, they need custom handling, +// not the generic handling. + FilterContainer.prototype.matchStringExactType = function(pageDetails, requestURL, requestType, requestHostname) { var url = requestURL.toLowerCase(); var pageDomain = pageDetails.pageDomain || ''; @@ -1419,13 +1423,6 @@ FilterContainer.prototype.matchStringExactType = function(pageDetails, requestUR FilterContainer.prototype.matchString = function(pageDetails, requestURL, requestType, requestHostname) { // adbProfiler.countUrl(); - // https://github.com/gorhill/uBlock/issues/116 - // Some type of requests are exceptional, they need custom handling, - // not the generic handling. - if ( requestType === 'popup' ) { - return this.matchStringExactType(pageDetails, requestURL, requestType, requestHostname); - } - // https://github.com/gorhill/httpswitchboard/issues/239 // Convert url to lower case: // `match-case` option not supported, but then, I saw only one diff --git a/js/traffic.js b/js/traffic.js index 1da595296..af7131e8c 100644 --- a/js/traffic.js +++ b/js/traffic.js @@ -152,7 +152,7 @@ var onBeforeSendHeaders = function(details) { // in multiple tabs. var reason = false; if ( µb.getNetFilteringSwitch(pageStore.pageHostname) ) { - reason = µb.abpFilters.matchString( + reason = µb.abpFilters.matchStringExactType( pageDetails, requestURL, 'popup',