mirror of
https://github.com/gorhill/uBlock.git
synced 2024-09-03 17:49:39 +02:00
Improve bad filter detection in element picker
Related issue: - https://github.com/uBlockOrigin/uBlock-issues/issues/1280
This commit is contained in:
parent
11b9f88b38
commit
c3f267db8f
@ -71,9 +71,17 @@ const filterFromTextarea = function() {
|
||||
if ( s === '' ) { return ''; }
|
||||
const pos = s.indexOf('\n');
|
||||
const filter = pos === -1 ? s.trim() : s.slice(0, pos).trim();
|
||||
staticFilteringParser.analyze(filter);
|
||||
staticFilteringParser.analyzeExtra();
|
||||
return staticFilteringParser.shouldDiscard() ? '!' : filter;
|
||||
const sfp = staticFilteringParser;
|
||||
sfp.analyze(filter);
|
||||
sfp.analyzeExtra();
|
||||
if (
|
||||
sfp.category !== sfp.CATStaticExtFilter &&
|
||||
sfp.category !== sfp.CATStaticNetFilter ||
|
||||
sfp.shouldDiscard()
|
||||
) {
|
||||
return '!';
|
||||
}
|
||||
return filter;
|
||||
};
|
||||
|
||||
/******************************************************************************/
|
||||
|
Loading…
Reference in New Issue
Block a user