mirror of
https://github.com/gorhill/uBlock.git
synced 2024-09-20 13:03:56 +02:00
Forbid usage of opening comment /*
in query-selectable test
Related issue: - https://github.com/uBlockOrigin/uBlock-issues/issues/1806
This commit is contained in:
parent
d8fea7f568
commit
630d436342
1 changed files with 5 additions and 1 deletions
|
@ -333,7 +333,7 @@ const Parser = class {
|
|||
if (
|
||||
this.selectorCompiler.compile(
|
||||
selector,
|
||||
hasBits(this.flavorBits, BITFlavorExtStrong),
|
||||
hasBits(this.flavorBits, BITFlavorExtStrong | BITFlavorExtStyle),
|
||||
this.result
|
||||
) === false
|
||||
) {
|
||||
|
@ -1450,11 +1450,15 @@ Parser.prototype.SelectorCompiler = class {
|
|||
return true;
|
||||
}
|
||||
|
||||
// https://github.com/uBlockOrigin/uBlock-issues/issues/1806
|
||||
// Forbid instances of:
|
||||
// - opening comment `/*`
|
||||
querySelectable(s) {
|
||||
if ( this.reSimpleSelector.test(s) ) { return true; }
|
||||
if ( this.div === null ) { return true; }
|
||||
try {
|
||||
this.div.querySelector(`${s},${s}:not(#foo)`);
|
||||
if ( s.includes('/*') ) { return false; }
|
||||
} catch (ex) {
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue