Header filters are not shown in the ABP panel in dev tools
Environment
- OS version: /
- Browser version: /
-
Extension version:
release-2020-1
- Last working version: n/a, header filtering is a new feature
Steps to reproduce
- Install the latest build for
release-2020-1
(I reproduced with this one: https://gitlab.com/eyeo/adblockplus/abpui/adblockplusui/-/pipelines/255038634) - In the Advanced tab, add filter
||testpages.adblockplus.org/testfiles/*$header=content-type=image/png
to the custom filters table - Go to a testpage: https://testpages.adblockplus.org/en/filters/image
- Open developer tools and go to the ABP panel (and reload the page, so that requests are shown)
Observed behavior
- Image is blocked (the container is not collapsed, but that's a different issue)
- The blocked request is not shown in the ABP panel.
Expected behavior
The request blocked with the $header
option should be logged in the ABP panel in developer tools.
Further information
Header filtering was implemented here: https://gitlab.com/eyeo/adblockplus/abpui/adblockplusui/-/issues/898
Hints for testers
This problem exists because we are checking a request for matching filters in multiple places in parallel. This means that we are notifying the developer tools panel multiple times per request. This fix takes care of the scenario where, at first, a request doesn't have any matching filters (e.g. URL filters), but it does in the subsequent header check.
This means that we cannot add a new record to the developer tools panel, as we usually do, but we need to update the already existing one to make sure that the filterless record is no longer being shown.
As a consequence, this means that, at least in theory, the case exists where a filterful record is being replaced with a filterless one.
The merge request also removes the "HEADER" filter option from the dropdown menu in the developer tools panel, because it was added by mistake, since there are no requests with the type "HEADER" (see discussion).