mirror of https://github.com/gorhill/uBlock.git
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 ''; }
|
if ( s === '' ) { return ''; }
|
||||||
const pos = s.indexOf('\n');
|
const pos = s.indexOf('\n');
|
||||||
const filter = pos === -1 ? s.trim() : s.slice(0, pos).trim();
|
const filter = pos === -1 ? s.trim() : s.slice(0, pos).trim();
|
||||||
staticFilteringParser.analyze(filter);
|
const sfp = staticFilteringParser;
|
||||||
staticFilteringParser.analyzeExtra();
|
sfp.analyze(filter);
|
||||||
return staticFilteringParser.shouldDiscard() ? '!' : filter;
|
sfp.analyzeExtra();
|
||||||
|
if (
|
||||||
|
sfp.category !== sfp.CATStaticExtFilter &&
|
||||||
|
sfp.category !== sfp.CATStaticNetFilter ||
|
||||||
|
sfp.shouldDiscard()
|
||||||
|
) {
|
||||||
|
return '!';
|
||||||
|
}
|
||||||
|
return filter;
|
||||||
};
|
};
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
Loading…
Reference in New Issue