From f78fb513a123e91dac9f98e5d9fd99313a6e2850 Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Thu, 15 Dec 2022 11:35:03 -0500 Subject: [PATCH] Support generic exception filter for HTML filtering Related feedback: - https://github.com/gorhill/uBlock/commit/fa5e4b7769c9759a588a4b842d79d3273c5756df#commitcomment-93202819 --- src/js/html-filtering.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/js/html-filtering.js b/src/js/html-filtering.js index 9867d1842..3da755f7e 100644 --- a/src/js/html-filtering.js +++ b/src/js/html-filtering.js @@ -327,6 +327,14 @@ htmlFilteringEngine.compile = function(parser, writer) { writer.select('HTML_FILTERS'); + // Only exception filters are allowed to be global. + if ( parser.hasOptions() === false ) { + if ( exception ) { + writer.push([ 64, '', 1, compiled ]); + } + return; + } + // TODO: Mind negated hostnames, they are currently discarded. for ( const { hn, not, bad } of parser.extOptions() ) {