mirror of
https://github.com/gorhill/uBlock.git
synced 2024-10-06 09:37:12 +02:00
Bail out early if missing required argument
This commit is contained in:
parent
596145ceb9
commit
6828e1c3b2
@ -1675,6 +1675,7 @@
|
|||||||
if ( selector === '{{1}}' ) {
|
if ( selector === '{{1}}' ) {
|
||||||
selector = '';
|
selector = '';
|
||||||
}
|
}
|
||||||
|
if ( selector === '' ) { return; }
|
||||||
let selectorCheck = '{{2}}';
|
let selectorCheck = '{{2}}';
|
||||||
if ( selectorCheck === '{{2}}' ) {
|
if ( selectorCheck === '{{2}}' ) {
|
||||||
selectorCheck = '';
|
selectorCheck = '';
|
||||||
@ -1721,7 +1722,7 @@
|
|||||||
const realFetch = self.fetch;
|
const realFetch = self.fetch;
|
||||||
self.fetch = new Proxy(self.fetch, {
|
self.fetch = new Proxy(self.fetch, {
|
||||||
apply: function(target, thisArg, args) {
|
apply: function(target, thisArg, args) {
|
||||||
if ( selector === '' || reUrl.test(urlFromArg(args[0])) === false ) {
|
if ( reUrl.test(urlFromArg(args[0])) === false ) {
|
||||||
return Reflect.apply(target, thisArg, args);
|
return Reflect.apply(target, thisArg, args);
|
||||||
}
|
}
|
||||||
return realFetch(...args).then(realResponse =>
|
return realFetch(...args).then(realResponse =>
|
||||||
|
Loading…
Reference in New Issue
Block a user