mirror of
https://github.com/gorhill/uBlock.git
synced 2024-11-10 17:17:57 +01: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
1 changed files with 11 additions and 3 deletions
|
@ -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 a new issue