Fix the logging of all `prevent-xhr` calls

Related feedback:
https://github.com/uBlockOrigin/uBlock-issues/discussions/3096#discussioncomment-8309729
This commit is contained in:
Raymond Hill 2024-01-30 20:52:07 -05:00
parent 1e614a7b10
commit 1db54c47e1
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2
1 changed files with 4 additions and 3 deletions

View File

@ -2525,11 +2525,12 @@ function noXhrIf(
return super.open(method, url, ...args);
}
const haystack = { method, url };
if ( matchObjectProperties(propNeedles, haystack) ) {
xhrInstances.set(this, haystack);
}
if ( propsToMatch === '' && directive === '' ) {
safe.uboLog(logPrefix, `Called: ${safe.JSON_stringify(haystack, null, 2)}`);
return super.open(method, url, ...args);
}
if ( matchObjectProperties(propNeedles, haystack) ) {
xhrInstances.set(this, haystack);
}
haystack.headers = Object.assign({}, headers);
return super.open(method, url, ...args);