diff --git a/src/js/traffic.js b/src/js/traffic.js index 95ea2f293..0fff1e1e8 100644 --- a/src/js/traffic.js +++ b/src/js/traffic.js @@ -304,8 +304,9 @@ var onBeforeRootFrameRequest = function(details) { // https://github.com/gorhill/uBlock/issues/3208 // Mind case insensitivity. + var toBlockDocResult = function(url, hostname, logData) { - if ( typeof logData.regex !== 'string' ) { return; } + if ( typeof logData.regex !== 'string' ) { return false; } var re = new RegExp(logData.regex, 'i'), match = re.exec(url.toLowerCase()); if ( match === null ) { return false; } @@ -313,14 +314,8 @@ var toBlockDocResult = function(url, hostname, logData) { // https://github.com/chrisaljoudi/uBlock/issues/1128 // https://github.com/chrisaljoudi/uBlock/issues/1212 // Relax the rule: verify that the match is completely before the path part - if ( - (match.index + match[0].length) <= - (url.indexOf(hostname) + hostname.length + 1) - ) { - return true; - } - - return false; + return (match.index + match[0].length) <= + (url.indexOf(hostname) + hostname.length + 1); }; /******************************************************************************/