mirror of
https://github.com/gorhill/uBlock.git
synced 2026-03-11 09:04:36 +00:00
fix #1955: discard cosmetic filters with pseudo-classes
This commit is contained in:
parent
43d699b1e2
commit
4851bc4f34
1 changed files with 5 additions and 3 deletions
|
|
@ -330,7 +330,7 @@ FilterParser.prototype.parse = function(raw) {
|
|||
}
|
||||
|
||||
// Extract the selector.
|
||||
this.suffix = raw.slice(rpos + 1);
|
||||
this.suffix = raw.slice(rpos + 1).trim();
|
||||
if ( this.suffix.length === 0 ) {
|
||||
this.cosmetic = false;
|
||||
return this;
|
||||
|
|
@ -791,10 +791,12 @@ FilterContainer.prototype.isValidSelector = (function() {
|
|||
var reStyleSelector = /^(.+?):style\((.+?)\)$/;
|
||||
var reStyleBad = /url\([^)]+\)/;
|
||||
|
||||
// Keep in mind: https://github.com/gorhill/uBlock/issues/693
|
||||
// Keep in mind:
|
||||
// https://github.com/gorhill/uBlock/issues/693
|
||||
// https://github.com/gorhill/uBlock/issues/1955
|
||||
var isValidCSSSelector = function(s) {
|
||||
try {
|
||||
div[matchesProp](s + ',\n#foo');
|
||||
div[matchesProp](s + ', ' + s + ':not(#foo)');
|
||||
} catch (ex) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue