Opened on 11/01/2016 at 12:28:48 PM

Closed on 11/10/2016 at 01:50:45 PM

Last modified on 11/11/2016 at 02:03:10 PM

#4593 closed change (fixed)

Support regular expressions for CSS property matching

Reported by: fhd Assignee: fhd
Priority: P2 Milestone:
Module: Core Keywords:
Cc: trev, kzar Blocked By:
Blocking: Platform: Unknown / Cross platform
Ready: no Confidential: no
Tester: Unknown Verified working: no
Review URL(s):

https://codereview.adblockplus.org/29361640/

Description

Background

CSS property matching is not particularly flexible. The syntax is the same as for URL filter expressions, which only supports the * wild card. Supporting regular expressions for property matching would make CSS property filters a lot more powerful.

What to change

Interpret the value of -abp-properties as a regular expression if it begins and ends with / (minus those characters). If the value doesn't begin and end with /, it should be interpreted as a filter matching expression, same as now.

Examples:

  • example.com##[-abp-properties="margin: 5px"] should match margin: 5px verbatim.
  • example.com##[-abp-properties="margin: *"] should match anything containing the string margin: .
  • example.com##[-abp-properties="/margin: [0-9]px"] should match /margin: [0-9]px verbatim.
  • example.com##[-abp-properties="margin: [0-9]px/"] should match margin: [0-9]px/ verbatim.
  • example.com##[-abp-properties="/margin: [0-9]px/"] should use the regular expression margin: [0-9]px for matching.

Attachments (0)

Change History (6)

comment:1 Changed on 11/01/2016 at 12:34:04 PM by fhd

  • Cc kzar added

comment:2 Changed on 11/03/2016 at 04:05:19 PM by fhd

  • Review URL(s) modified (diff)
  • Status changed from new to reviewing

comment:3 Changed on 11/03/2016 at 06:52:03 PM by fhd

  • Blocking 4600 added

comment:4 Changed on 11/10/2016 at 01:47:17 PM by abpbot

A commit referencing this issue has landed:
Issue 4593 - Support regular expressions for CSS property matching

comment:5 Changed on 11/10/2016 at 01:50:45 PM by fhd

  • Resolution set to fixed
  • Status changed from reviewing to closed

comment:6 Changed on 11/11/2016 at 02:03:10 PM by trev

  • Blocking 4600 removed

Add Comment

Modify Ticket

Change Properties
Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from fhd.
 
Note: See TracTickets for help on using tickets.