1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-07-05 11:37:01 +02:00

Bail out early if missing required argument

This commit is contained in:
Raymond Hill 2022-09-25 06:57:51 -04:00
parent 596145ceb9
commit 6828e1c3b2
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2

View File

@ -1675,6 +1675,7 @@
if ( selector === '{{1}}' ) {
selector = '';
}
if ( selector === '' ) { return; }
let selectorCheck = '{{2}}';
if ( selectorCheck === '{{2}}' ) {
selectorCheck = '';
@ -1721,7 +1722,7 @@
const realFetch = self.fetch;
self.fetch = new Proxy(self.fetch, {
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 realFetch(...args).then(realResponse =>