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

Improve loggger output of prevent-fetch scriptlet

Related feedback:
https://github.com/uBlockOrigin/uBlock-issues/discussions/3115
This commit is contained in:
Raymond Hill 2024-02-13 16:12:11 -05:00
parent 246ae91c79
commit 6551cab525
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2

View File

@ -1997,10 +1997,6 @@ function noFetchIf(
const details = args[0] instanceof self.Request
? args[0]
: Object.assign({ url: args[0] }, args[1]);
if ( propsToMatch === '' && responseBody === '' ) {
safe.uboLog(logPrefix, `Called: ${safe.JSON_stringify(details, null, 2)}`);
return Reflect.apply(target, thisArg, args);
}
let proceed = true;
try {
const props = new Map();
@ -2013,6 +2009,11 @@ function noFetchIf(
if ( typeof v !== 'string' ) { continue; }
props.set(prop, v);
}
if ( propsToMatch === '' && responseBody === '' ) {
const out = Array.from(props).map(a => `${a[0]}:${a[1]}`);
safe.uboLog(logPrefix, `Called: ${out.join('\n')}`);
return Reflect.apply(target, thisArg, args);
}
proceed = needles.length === 0;
for ( const { key, re } of needles ) {
if (