diff --git a/src/js/contentscript.js b/src/js/contentscript.js index da8e4c7aa..05422e690 100644 --- a/src/js/contentscript.js +++ b/src/js/contentscript.js @@ -574,6 +574,10 @@ vAPI.injectScriptlet = function(doc, text) { 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 ) {