Opened 4 years ago

Last modified 3 years ago

#4329 closed change

[abp2blocklist] Add (very rough) $generichide and $genericblock support — at Version 1

Reported by: kzar Assignee:
Priority: Unknown Milestone:
Module: Platform Keywords: abp2blocklist, AcceptableAds
Cc: sebastian, mario Blocked By:
Blocking: #4321 Platform: Unknown / Cross platform
Ready: no Confidential: no
Tester: Unknown Verified working: no
Review URL(s):

https://codereview.adblockplus.org/29439639/
https://codereview.adblockplus.org/29441592/

Description (last modified by kzar)

Background

Currently abp2blocklist completely ignores $generichide and $genericblock filter options. While we cannot support them properly it might be possible to do something with them, hopefully reducing false positives. Content blocking rules have a limited unless-domain trigger field which we could perhaps use for some of our generic rules.

What to change

For $generichide and $genericblock exception filters take the hostname and put it (and the www. subdomain) into the unless-domain trigger for any generic blocking/hiding rules which don't already have an if-domain trigger.

Notes

Limitations:

  • The filter would often match all subdomains, where as the unless-domain field can only match the domain itself and any common subdomains we can think of in advance. (Like www. for example.)
  • The unless-domain field can not be used when the if-domain field is already being used for a rule.
  • See the related docs.

Implementation detail:
There could be three shared arrays, one for no $generichide domains, one for no $genericblock domains and one for no $generichide or $genericblock domains. Then we can simply append domains to those, sharing the reference to the arrays between all rules that need to use them.

Change History (1)

comment:1 Changed 4 years ago by kzar

  • Description modified (diff)
Note: See TracTickets for help on using tickets.