Unify regional and default list formats #103
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This will be a breaking change, although it should help us to remove duplicated logic across several repos, and will allow us to bundle multiple list sources in each regional component going forwards.
To summarize the changes:
title
,url
, andsupport_url
are moved into individual objects within asources
list for each componentsources
is a list so it can now support multiple list sources bundled into the same componentdefault.json
andregional.json
now share the exact same structureCode that depends on these files:
adblock-resources
Tests in this repo were updated in this PR.
brave-core-crx-packager
Needs to be updated to pull potentially multiple URLs into each list. There are multiple codepaths dedicated to building the default component and the regional components, which can be deduplicated.
TODO
brave-core
regional_catalog.json
, which is shipped directly fromfilter_lists/regional.json
in a component, gets parsed into a vector ofFilterListCatalogEntry
structs by Chromium'sJSONValueConverter
.According to the comment documentation:
...it appears that the removal of
url
andsupport_url
from the top-level filter list object should not cause any issues here, as perDo not report failures for missing fields
. Those fields are defined in the parsed struct, but not used in the browser.TODO
If for some reason it doesn't work, we can have brave-core-crx-packager repackage it with the problematic fields added back, then update brave-core to migrate to a new component with the newer format.brave-ios
brave-ios
uses the same code asbrave-core
to download the regional catalog component and parse the fields. It also doesn't use theurl
orsupport_url
fields. Ifbrave-core
works, thenbrave-ios
should work too.slim-list-lambda
The
assemble.js
script references the regional catalog from this repo and needs to be updated to handle potentially multiple URLs.TODO
adblock-rust
tests/live.rs
usesregional.json
. It's lower priority, but this should also be updated to work with the newer format.TODO