1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-07-08 04:49:12 +02:00

Disallow -abp-... filters if not using #?#

Related feedback:
- https://github.com/uBlockOrigin/uBlock-issues/issues/2435#issuecomment-1367805459
This commit is contained in:
Raymond Hill 2023-01-01 09:20:32 -05:00
parent 3c9ad16359
commit 72dabcac66
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2

View File

@ -1536,7 +1536,6 @@ Parser.prototype.SelectorCompiler = class {
default:
break;
}
if ( head ) {
if ( args ) {
this.astFlatten(head.data, args);
@ -1548,7 +1547,9 @@ Parser.prototype.SelectorCompiler = class {
}
}
if ( data.type !== 'PseudoClassSelector' ) { return; }
if ( data.name.startsWith('-abp-') && this.asProcedural === false ) {
return;
}
// Post-analysis, mind:
// - https://w3c.github.io/csswg-drafts/selectors-4/#has-pseudo
// - https://w3c.github.io/csswg-drafts/selectors-4/#negation