Decouple adblock engines from component loading methods
See original GitHub issueInitially, adblock engines were only loaded with sources from Brave’s component server. Over time, additional adblock engines were added that load from the browser’s local preferences (custom filters) or from remote 3rd party servers (subscription lists). The code is still structured to support the initial use-case, which is confusing and limits future improvements. Once this is implemented properly, it will unblock future work like being able to combine the engines together for performance reasons, or untangling threading concerns.
This should ultimately be achieved by removing BraveComponent
from the AdBlockService
inheritance tree, and replacing it with a common SourceProvider
interface that is generic enough to be implemented by the necessary components, custom filters loader, or subscription lists.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:6 (1 by maintainers)
Top GitHub Comments
@LaurenWags in terms of high impact areas, it’d definitely be good to check that ads on popular sites are still blocked consistently (in particular YouTube and perhaps some news sites).
It could be good to double-check the test plan from https://github.com/brave/brave-core/pull/11621. Other than that, I don’t have a good sense of where there might be any issues (or I would have fixed them already 😉). We do have a decent amount of automated test coverage here, but creativity would be appreciated!
Verified ‘Passed’ using
Testcase 1: Verify when Brave flag is enabled, cookie notice is dismissed and when disabled, cookie notice is displayed again
I. Enable
#brave-adblock-cookie-list-default
inbrave://flags
Brave
Cookie notice
displayed on the topbrave://flags
and enabled#brave-adblock-cookie-list-default
Relaunch
to relaunch the browsercookie notice
no longer is displayedbrave://adblock
and verified an entry forEasylist-Cookie List - Filter Obtrusive Cookie Notices
is available underAdditional filters
and is checkedII. Disable #brave-adblock-cookie-list-default in brave://flags
brave://flag
and disabled#brave-adblock-cookie-list-default
Relaunch
to relaunch the browsercookie notice
displayed againEasylist-Cookie List - Filter Obtrusive Cookie Notices
is uncheckedTestcase #2 - Verify cookie banner is dismissed with aggressive mode in Shields
I. Enable #brave-adblock-cookie-list-default in brave://flags
brave://flags
and enabled#brave-adblock-cookie-list-default
Relaunch
to relaunch the browsercookie notice
still displayedEasylist-Cookie List - Filter Obtrusive Cookie Notices
is available and is checkedShields
to select toAggressive
mode in `Trackers & ads blocked``cookie notice
no longer displayedII. Disable
#brave-adblock-cookie-list-default
inbrave://flags
brave://flag
and disabled#brave-adblock-cookie-list-default
Relaunch
to relaunch the browsercookie notice
displayed at the bottomEasylist-Cookie List - Filter Obtrusive Cookie Notices
inbrave://adblock
is uncheckedTestcase #3 - Manually toggle `Easylist-Cookie List - Filter Obtrusive Cookie Notices’
brave://adblock
and checkedEasylist-Cookie List - Filter Obtrusive Cookie Notices
brave://flag
and enabled#brave-adblock-cookie-list-default
Relaunch
to relaunch the browsercookie notice
is not displayedbrave://adblock
and verifiedEasylist-Cookie List - Filter Obtrusive Cookie Notices
still checkedbrave://flags
disabled #brave-adblock-cookie-list-default flag and restarted the browser.brave://adblock
and verified an entry forEasylist-Cookie List - Filter Obtrusive Cookie Notices
is still checkedbrave://adblock
and uncheckedEasylist-Cookie List - Filter Obtrusive Cookie Notices
brave://flags
and enabled#brave-adblock-cookie-list-default
flag and restarted the browser.cookie notice
is displayedNote: In addition to above testing, verified
Shields
functionality works same as expected by comparing1.37.x
with1.36.x
.