Implement HTTP header filtering
Background / User story
eyeo/adblockplus/adblockpluscore#77 implements the filter option
$header to allow URL blocking filters to match on http response headers.
What to change
- Design: N/A
- Research: N/A
- Spec: N/A
- Legal: N/A
Development: Implement the blocking in a
lib/requestBlocking.js. Filters should be queried with
defaultMatcher.search()and request blocking should check for
WhitelistFilterfirst and then blocking filter. See details in eyeo/adblockplus/adblockpluscore#77 on the expected blocking filters.
Hints for testers
There is a write up in confluence https://confluence.eyeo.com/display/ABC/HTTP+header+filtering (not externally viewable). This will be edited and added to the public documentation in the future.
Testing this feature:
- testing the header blocking:
example.com, based on the content-type.
- testing allowlisting for header blocking on a domain.
@@||example.com/images/*$headerwill disable header based blocking for this URL.
- testing allowlisting for the whole domain:
@@||example.com/images/*should also disable ANY header based blocking for the URL.
Hints for translators
It is possible that this be rendered impractical in manifest v3, however having this for other browsers is worth it.
Since we are likely to call the matcher for most requests, performance is important.