Skip to content
Permalink
Browse files
Strict-block only if match is anchored to end of hostname
As per feedback from filter list maintainers.
  • Loading branch information
gorhill authored and JustOff committed Jun 21, 2020
1 parent c92cb51 commit 01325d109300e36c56196693df686b6a41f64350
Showing with 5 additions and 3 deletions.
  1. +5 −3 src/js/traffic.js
@@ -320,9 +320,11 @@ 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
return (match.index + match[0].length) <=
(url.indexOf(hostname) + hostname.length + 1);
// Verify that the end of the match is anchored to the end of the
// hostname.
var end = match.index + match[0].length -
url.indexOf(hostname) - hostname.length;
return end === 0 || end === 1;
};

/******************************************************************************/

0 comments on commit 01325d1

Please sign in to comment.