From 5eff4a027aff425c9eda8e116b1a3f57984947f5 Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Mon, 20 May 2019 18:29:28 -0400 Subject: [PATCH] Fix https://github.com/gorhill/uBlock/issues/3541 --- src/js/reverselookup-worker.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/js/reverselookup-worker.js b/src/js/reverselookup-worker.js index 1689f838e..529388631 100644 --- a/src/js/reverselookup-worker.js +++ b/src/js/reverselookup-worker.js @@ -117,6 +117,7 @@ const fromCosmeticFilter = function(details) { const prefix = match[0]; const exception = prefix.charAt(1) === '@'; const selector = details.rawFilter.slice(prefix.length); + const isHtmlFilter = prefix.endsWith('^'); // The longer the needle, the lower the number of false positives. const needle = selector.match(/\w+/g).reduce(function(a, b) { @@ -182,6 +183,9 @@ const fromCosmeticFilter = function(details) { continue; } + // Do not confuse cosmetic filters with HTML ones. + if ( (fargs[0] === 64) !== isHtmlFilter ) { continue; } + switch ( fargs[0] ) { // Lowly generic cosmetic filters case 0: // simple id-based