Fix `urlskip=` with `-blocked` directive for blocked requests

Related feedback:
https://github.com/uBlockOrigin/uBlock-issues/issues/3206#issuecomment-2441470631
This commit is contained in:
Raymond Hill 2024-10-28 14:13:50 -04:00
parent ac4506091e
commit c07db7553d
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2
1 changed files with 6 additions and 2 deletions

View File

@ -925,8 +925,11 @@ const PageStore = class {
}
redirectBlockedRequest(fctxt) {
const directives = staticNetFilteringEngine.redirectRequest(redirectEngine, fctxt);
if ( directives === undefined ) { return; }
const directives = staticNetFilteringEngine.redirectRequest(redirectEngine, fctxt) || [];
if ( this.urlSkippableResources.has(fctxt.itype) ) {
staticNetFilteringEngine.urlSkip(fctxt, true, directives);
}
if ( directives.length === 0 ) { return; }
if ( logger.enabled !== true ) { return; }
fctxt.pushFilters(directives.map(a => a.logData()));
if ( fctxt.redirectURL === undefined ) { return; }
@ -1152,6 +1155,7 @@ const PageStore = class {
µb.FilteringContext.MAIN_FRAME,
µb.FilteringContext.MEDIA,
µb.FilteringContext.OBJECT,
µb.FilteringContext.OTHER,
µb.FilteringContext.SUB_FRAME,
]);