Add support for attaching meta data to custom filters
Background
Considering that custom filters can be added through various means (e.g. manually writing filters, adding suggested filters, en-/disabling ad blocking on certain domains), it's currently impossible to target only certain filters, when trying to rectify any problems that could result in the unintentional creation of certain filters. Furthermore, it can help us more effectively manage custom filters under the limitations of Manifest v3's filter quotas. Therefore it would be helpful to have the ability to attach and retrieve certain meta data for newly created custom filters.
Use case
- Getting a better understanding about when custom filters were created and by what means, to inform future product decisions.
- Selectively modifying custom filters based on their creation date and origin, to be able to recover from problems and make more effective use of Manifest v3's filter quotas.
What to change
- Provide a way for retrieving a given custom filter's creation date.
- Provide a way for associating additional meta data with a given custom filter.
- Provide a way for retrieving such additional meta data for a given custom filter, that doesn't cause any performance problems when done on a regular basis.
Example API
EWE.filters.add(string text, object<string, any> [tags])
-
Filter
-
number [created]
UNIX timestamp assigned when callingEWE.filters.add()
-
object [tags]
key-value pairs (e.g.origin: "filter-composer"
)
-
Note that it may be sufficient to only allow JSON primitives (i.e. boolean
, null
, number
, string
) as values for tags
. It doesn't need to support values that are more difficult to store, such as symbols, functions or regular expressions.