Opened on 11/14/2017 at 11:41:32 AM
Closed on 02/22/2018 at 05:39:20 PM
Last modified on 03/02/2018 at 03:07:39 PM
#6034 closed change (fixed)
Add support for regular expressions in :-abp-contains()
Reported by: | Lain_13 | Assignee: | hfiguiere |
---|---|---|---|
Priority: | P2 | Milestone: | |
Module: | Core | Keywords: | circumvention |
Cc: | fhd, sebastian, mapx, kzar, hfiguiere, mjethani, sergz | Blocked By: | |
Blocking: | Platform: | Unknown / Cross platform | |
Ready: | yes | Confidential: | no |
Tester: | Unknown | Verified working: | no |
Review URL(s): |
Description
As I understand right now -abp-contains supports only straight text. As the result any variations in it will require a new rule to be added. This makes avoiding filters based on -abp-contains ridiculously simple. Just replace a few characters with similar characters from another language and that's it. Also, site my display a few different patters for ads. Each require separate filter to block.
Regular expressions support in -abp-contains() should fix both issues since it will be possible to write rules like :-abp-contains(/[aа]dv[eе]rt[iі]s[eе]m[eе]nt/) in order to block variations of the same text with foreign characters (notice Russian "а/е" and Ukrainian "і"). Or like this: :-abp-contains(/advertisement|banner/) in order to hide blocks with either 'advertisement' or 'banner' text in them.
BTW, uBlock Origin already supports regular expressions there since they added support for :-abp-contains() as an alias for already existing their own similar feature.
Environment
Adblock Plus development build 3.0.0.1921
Google Chrome 62
How to reproduce
- Add filter:
lostfilm-online.ru#?#body > div[style] > div > .block:-abp-has(.block_head:-abp-contains(/Вас\sзаинтересует|Дешевле|Вам\sпонравится|Интересное\sв\sсети/))
- Visit lostfilm-online.ru
Observed behaviour
Ads on the left side are visible with ABP, but blocked with uBlock Origin.
Expected behaviour
Ads are blocked with both extensions.
Attachments (0)
Change History (12)
comment:1 Changed on 11/14/2017 at 03:28:11 PM by mapx
comment:2 Changed on 11/14/2017 at 03:29:24 PM by mapx
- Cc fhd trev sebastian mapx added
comment:3 Changed on 11/14/2017 at 03:29:44 PM by mapx
- Component changed from Unknown to Platform
comment:4 Changed on 11/17/2017 at 02:01:49 PM by kzar
- Cc kzar hfiguiere added
comment:5 Changed on 11/20/2017 at 07:40:57 PM by hfiguiere
- Owner set to hfiguiere
comment:6 Changed on 11/21/2017 at 09:01:42 PM by hfiguiere
- Review URL(s) modified (diff)
- Status changed from new to reviewing
comment:7 Changed on 12/21/2017 at 11:26:28 AM by fhd
- Cc trev removed
comment:8 Changed on 01/08/2018 at 03:22:07 PM by kzar
- Cc mjethani sergz added
- Component changed from Platform to Core
- Priority changed from Unknown to P2
- Ready set
comment:9 Changed on 01/09/2018 at 07:23:21 PM by mapx
While on it did you consider the Regular expression flags too ?
see
https://github.com/gorhill/uBlock/issues/3372
https://github.com/gorhill/uBlock/commit/17dfec5759fa76372683262f6241084473ab40e0
comment:10 Changed on 02/22/2018 at 05:38:30 PM by abpbot
A commit referencing this issue has landed:
Issue 6034 - :-abp-contains() accept a regular expression
comment:11 Changed on 02/22/2018 at 05:39:20 PM by hfiguiere
- Resolution set to fixed
- Status changed from reviewing to closed
comment:12 Changed on 03/02/2018 at 03:07:39 PM by mjethani
- Keywords circumvention added
The support for regular expressions exists for abp-properties
https://issues.adblockplus.org/ticket/4593