From 4d4a5f380799b64c167e42331a37d7be2f917214 Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Thu, 10 Nov 2022 08:47:54 -0500 Subject: [PATCH] Mind implicit prelude `*` element in pseudo operators Related issue: - https://github.com/uBlockOrigin/uBlock-issues/issues/2355 --- src/js/static-filtering-parser.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/js/static-filtering-parser.js b/src/js/static-filtering-parser.js index f36b5dcf4..66c6c1d72 100644 --- a/src/js/static-filtering-parser.js +++ b/src/js/static-filtering-parser.js @@ -1728,12 +1728,14 @@ Parser.prototype.SelectorCompiler = class { break; case 'ProceduralSelector': if ( prelude.length !== 0 ) { - if ( tasks.length === 0 ) { - out.selector = prelude.join(''); - } else { - tasks.push(this.createSpathTask(prelude.join(''))); - } + let spath = prelude.join(''); prelude.length = 0; + if ( spath.endsWith(' ') ) { spath += '*'; } + if ( tasks.length === 0 ) { + out.selector = spath; + } else { + tasks.push(this.createSpathTask(spath)); + } } const args = this.compileArgumentAst(data.name, part.args); if ( args === undefined ) { return; }