Skip to content

Commit

Permalink
Fix broken :spath operators starting with >
Browse files Browse the repository at this point in the history
Related feedback:
- gorhill/uBlock@7dd48a6#r41180568

Regression from:
- gorhill/uBlock@7dd48a6
  • Loading branch information
gorhill authored and hawkeye116477 committed Aug 11, 2020
1 parent c79db5c commit 2103e23
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/js/contentscript.js
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,10 @@ vAPI.DOMFilterer = (function() {
constructor(task) {
this.spath = task[1];
this.nth = /^(?:\s*[+~]|:)/.test(this.spath);
if ( this.nth ) { return; }
if ( /^\s*>/.test(this.spath) ) {
this.spath = `:scope ${this.spath.trim()}`;
}
}
qsa(node) {
if ( this.nth === false ) {
Expand Down

0 comments on commit 2103e23

Please sign in to comment.