mirror of
https://github.com/gorhill/uBlock.git
synced 2024-11-22 18:32:45 +01:00
Properly handle unsupported `nth-child(an of selector)
Related feedback: - https://github.com/uBlockOrigin/uBlock-issues/issues/2284#issuecomment-1280325910
This commit is contained in:
parent
25b0a2c90c
commit
04119e9cdd
@ -1614,6 +1614,7 @@ Parser.prototype.SelectorCompiler = class {
|
||||
out.push(`#${data.name}`);
|
||||
break;
|
||||
case 'Nth': {
|
||||
if ( data.selector !== null ) { return; }
|
||||
if ( data.nth.type === 'AnPlusB' ) {
|
||||
const a = parseInt(data.nth.a, 10) || null;
|
||||
const b = parseInt(data.nth.b, 10) || null;
|
||||
@ -1637,7 +1638,9 @@ Parser.prototype.SelectorCompiler = class {
|
||||
case 'PseudoElementSelector':
|
||||
out.push(`:${data.name}`);
|
||||
if ( Array.isArray(part.args) ) {
|
||||
out.push(`(${this.astSerialize(part.args)})`);
|
||||
const arg = this.astSerialize(part.args);
|
||||
if ( typeof arg !== 'string' ) { return; }
|
||||
out.push(`(${arg})`);
|
||||
}
|
||||
break;
|
||||
case 'Raw':
|
||||
|
Loading…
Reference in New Issue
Block a user