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

Prevent the creation of non-cosmetic extended filters in element picker

Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/2232
This commit is contained in:
Raymond Hill 2022-11-19 12:29:10 -05:00
parent 86c8023163
commit 44753053c3
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2

View File

@ -113,11 +113,10 @@ const filterFromTextarea = function() {
const sfp = staticFilteringParser;
sfp.analyze(filter);
sfp.analyzeExtra();
if (
sfp.category !== sfp.CATStaticExtFilter &&
sfp.category !== sfp.CATStaticNetFilter ||
sfp.shouldDiscard()
) {
if ( sfp.shouldDiscard() ) { return '!'; }
if ( sfp.category === sfp.CATStaticExtFilter ) {
if ( sfp.hasFlavor(sfp.BITFlavorExtCosmetic) === false ) { return '!'; }
} else if ( sfp.category !== sfp.CATStaticNetFilter ) {
return '!';
}
return filter;