From 1581ec20d87713ff31ec6a3da4f84650b5f4b6ca Mon Sep 17 00:00:00 2001 From: gorhill Date: Sun, 28 May 2017 16:57:02 -0400 Subject: [PATCH] fix #2659 (regression) --- platform/chromium/manifest.json | 2 +- src/js/traffic.js | 31 +++++++++++++++---------------- 2 files changed, 16 insertions(+), 17 deletions(-) diff --git a/platform/chromium/manifest.json b/platform/chromium/manifest.json index 6635294aa..04edc9f3c 100644 --- a/platform/chromium/manifest.json +++ b/platform/chromium/manifest.json @@ -2,7 +2,7 @@ "manifest_version": 2, "name": "uBlock Origin", - "version": "1.12.5.14", + "version": "1.12.5.15", "commands": { "launch-element-zapper": { diff --git a/src/js/traffic.js b/src/js/traffic.js index e01331658..6b840ee27 100644 --- a/src/js/traffic.js +++ b/src/js/traffic.js @@ -235,7 +235,7 @@ var onBeforeRootFrameRequest = function(details) { // Check for specific block if ( result === 0 ) { result = snfe.matchStringExactType(context, requestURL, 'main_frame'); - if ( result !== 0 && logEnabled === true ) { + if ( result !== 0 || logEnabled === true ) { logData = snfe.toLogData(); } } @@ -243,21 +243,20 @@ var onBeforeRootFrameRequest = function(details) { // Check for generic block if ( result === 0 ) { result = snfe.matchStringExactType(context, requestURL, 'no_type'); - if ( result !== 0 ) { - if ( result === 1 || logEnabled === true ) { - logData = snfe.toLogData(); - } - // https://github.com/chrisaljoudi/uBlock/issues/1128 - // Do not block if the match begins after the hostname, except when - // the filter is specifically of type `other`. - // https://github.com/gorhill/uBlock/issues/490 - // Removing this for the time being, will need a new, dedicated type. - if ( - result === 1 && - toBlockDocResult(requestURL, requestHostname, logData) === false - ) { - result = 0; - } + if ( result !== 0 || logEnabled === true ) { + logData = snfe.toLogData(); + } + // https://github.com/chrisaljoudi/uBlock/issues/1128 + // Do not block if the match begins after the hostname, except when + // the filter is specifically of type `other`. + // https://github.com/gorhill/uBlock/issues/490 + // Removing this for the time being, will need a new, dedicated type. + if ( + result === 1 && + toBlockDocResult(requestURL, requestHostname, logData) === false + ) { + result = 0; + logData = undefined; } }