Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

webRequestInternal.eventHandled #2450

Closed
3 tasks done
Novablox opened this issue Nov 3, 2023 · 6 comments
Closed
3 tasks done

webRequestInternal.eventHandled #2450

Novablox opened this issue Nov 3, 2023 · 6 comments
Assignees
Labels

Comments

@Novablox
Copy link

Novablox commented Nov 3, 2023

I tried to reproduce the issue when...

  • AdNauseam is the only extension.
  • AdNauseam uses default lists and settings.
  • using a new, unmodified browser profile.

Description

Error in event handler: TypeError: Error in invocation of webRequestInternal.eventHandled(string eventName, string subEventName, string requestId, integer webViewInstanceId, optional webRequest.BlockingResponse response): Error at parameter 'response': Error at property 'responseHeaders': Invalid type: expected webRequest.HttpHeaders, found object.

URL(s) where the issue occurs.

No response

Screenshot(s)

jjjjj

Steps to Reproduce

No response

Configuration

default

@mneunomne
Copy link
Collaborator

I verify this is occurring, but I am currently not sure where this error is coming from... it's to find since I can't trace it to a specific function in adn. Perhaps need to rollback and see when this has started.

@mneunomne
Copy link
Collaborator

I can confirm this has started in v3.17.9b1 version, trying to find out why

@mneunomne mneunomne changed the title manifest version: 2 Error webRequestInternal.eventHandled Nov 25, 2023
@mneunomne
Copy link
Collaborator

Seems like it is being caused here:

AdNauseam/src/js/traffic.js

Lines 811 to 813 in ae3ade5

if ( injectPP(fctxt, pageStore, responseHeaders) === true ) {
modifiedHeaders = true;
}

and the function:

AdNauseam/src/js/traffic.js

Lines 1262 to 1288 in ae3ade5

const injectPP = function(fctxt, pageStore, responseHeaders) {
const permissions = [];
const directives = staticNetFilteringEngine.matchAndFetchModifiers(fctxt, 'permissions');
if ( directives !== undefined ) {
for ( const directive of directives ) {
if ( directive.result !== 1 ) { continue; }
permissions.push(directive.value.replace('|', ', '));
}
}
if ( logger.enabled && directives !== undefined ) {
fctxt.setRealm('network')
.pushFilters(directives.map(a => a.logData()))
.toLogger();
}
if ( permissions.length === 0 ) { return; }
µb.updateToolbarIcon(fctxt.tabId, 0x02);
responseHeaders.push({
name: 'permissions-policy',
value: permissions.join(', ')
});
return true;
};

@mneunomne
Copy link
Collaborator

This commit:

5ebdbf3

@mneunomne mneunomne mentioned this issue Nov 25, 2023
@mneunomne
Copy link
Collaborator

mneunomne commented Nov 25, 2023

Fixing with #2471
The issue was how the adnOnHeadersRecieved function was being returned

return {responseHeaders: headers}

instead of

return responseHeaders

@mneunomne
Copy link
Collaborator

Fixed, closing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants