Attach basic meta data to new custom filters
Background / User story
With https://gitlab.com/eyeo/adblockplus/abc/webext-sdk/-/issues/157, we're starting to be able to attach custom meta data to custom filters. Therefore we should use that new capability to attach some basic meta data to filters, that allow us to better understand the context in which the filter was created.
What to change
- Design: N/A
- Research: N/A
- Spec: N/A
- Legal: TBD
-
Development: Attach the following data to each custom filter that's created via the Messaging API (i.e. "filters.add", "filters.allowlist", "filters.importRaw", "filters.replace"):
-
created
: Timestamp corresponding to when the filter was created. -
origin
: Optional short string indicating which part of the extension the filter originated from.
-
Hints for testers
This change was merged into the feature-8 branch.
Adding a custom filter should have the following meta data attached to it, depending on how it was added:
Method | Has creation date? | Has origin string? |
---|---|---|
Add allowlisting filter for domain or page via icon popup | yes | yes: "popup" |
Add allowlisting filter via allowlisting API | yes | yes: "web" |
Add any custom filter via other means (e.g. via custom filter tab) | yes | no |
Preexisting custom filters | no | no |
Since we're not displaying the meta data anywhere in the UI, it can be retrieved either by:
- Using
ewe.filters.getMetaData(filterText).then(console.log)
. Requires exposing theewe
variable to the JavaScript console first (e.g. by setting a breakpoint in a module and writingwindow.ewe = ewe
. - Looking at the binary data stored in the "EWE" IndexedDB database. Requires experience with using IndexedDB.
Known issue: https://gitlab.com/eyeo/adblockplus/abc/webext-sdk/-/issues/213 (fixed in #1111 (closed))
Hints for translators
N/A