From d784fda98bc1359cbec7faf42fb39be4a635c342 Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Wed, 10 Jun 2020 09:53:21 -0400 Subject: [PATCH] Fix matching of filters with trailing `^|` Related feedback: - https://www.reddit.com/r/uBlockOrigin/comments/h08132/can_we_enable_javascript_on_the_homepage_but/ftkxvc5/ The right bound of the match needs to be incremented when a trailing `^` matches a character. --- src/js/static-net-filtering.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/js/static-net-filtering.js b/src/js/static-net-filtering.js index 7ccfaf8c8..3dd2f1bf1 100644 --- a/src/js/static-net-filtering.js +++ b/src/js/static-net-filtering.js @@ -1020,8 +1020,12 @@ registerFilterClass(FilterAnchorRight); const FilterTrailingSeparator = class { match() { - return $patternMatchRight === $requestURL.length || - isSeparatorChar(bidiTrie.haystack[$patternMatchRight]); + if ( $patternMatchRight === $requestURL.length ) { return true; } + if ( isSeparatorChar(bidiTrie.haystack[$patternMatchRight]) ) { + $patternMatchRight += 1; + return true; + } + return false; } logData(details) {