question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Decouple adblock engines from component loading methods

See original GitHub issue

Initially, 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:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
antonok-edmcommented, Mar 3, 2022

@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!

1reaction
MadhaviSeelamcommented, Mar 12, 2022

Verified ‘Passed’ using

Brave 1.37.89 Chromium: 99.0.4844.51 (Official Build) beta (64-bit)
Revision d537ec02474b5afe23684e7963d538896c63ac77-refs/branch-heads/4844@{#875}
OS Windows 11 Version 21H2 (Build 22000.556)

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 in brave://flags

  • Install 1.37.x
  • Launch Brave
  • Visited https://digikey.com
  • Cookie notice displayed on the top
  • Visit brave://flags and enabled #brave-adblock-cookie-list-default
  • Clicked Relaunch to relaunch the browser
  • Visited https://digikey.com and verified cookie notice no longer is displayed
  • Visited brave://adblock and verified an entry for Easylist-Cookie List - Filter Obtrusive Cookie Notices is available under Additional filters and is checked

II. Disable #brave-adblock-cookie-list-default in brave://flags

  • Visited brave://flag and disabled #brave-adblock-cookie-list-default
  • Clicked Relaunch to relaunch the browser
  • Visited https://digikey.com and verified cookie notice displayed again
  • Verified Easylist-Cookie List - Filter Obtrusive Cookie Notices is unchecked
1 2 3 4 5 6 7
1-cookienotice 2-flagenabled 3 easylistcookiechecked 4 cookienoticedismissed 5 flagdisabled 6 Cookienoticeddisplayedagain 7-easylistcookielistunchecked

Testcase #2 - Verify cookie banner is dismissed with aggressive mode in Shields

I. Enable #brave-adblock-cookie-list-default in brave://flags

  • Clean profile
  • Visited https://gulfnews.com
  • Cookie notice displayed at the bottom
  • Visited brave://flags and enabled #brave-adblock-cookie-list-default
  • Clicked Relaunch to relaunch the browser
  • Visited https://gulfnews.com but the cookie notice still displayed
  • Visited brave://adblock and verified an entry for Easylist-Cookie List - Filter Obtrusive Cookie Notices is available and is checked
  • Click on the Shields to select to Aggressive mode in `Trackers & ads blocked``
  • Verified cookie notice no longer displayed

II. Disable #brave-adblock-cookie-list-default in brave://flags

  • Visited brave://flag and disabled #brave-adblock-cookie-list-default
  • Clicked Relaunch to relaunch the browser
  • Visited https://gulfnews.com and verified cookie notice displayed at the bottom
  • Verified Easylist-Cookie List - Filter Obtrusive Cookie Notices in brave://adblock is unchecked
1 2 3 4 5 6 7
1-cookienotice 2 flagenabled 1-cookienotice 3 easlylist-cookie 4 cookienotice 5 flagdisabled 6 Cookienoticeddisplayedagain

Testcase #3 - Manually toggle `Easylist-Cookie List - Filter Obtrusive Cookie Notices’

  • Clean profile
  • Visited brave://adblock and checked Easylist-Cookie List - Filter Obtrusive Cookie Notices
  • Visited brave://flag and enabled #brave-adblock-cookie-list-default
  • Clicked Relaunch to relaunch the browser
  • Visited https://digikey.com and verified cookie notice is not displayed
  • Visited brave://adblock and verified Easylist-Cookie List - Filter Obtrusive Cookie Notices still checked
  • Returned to brave://flags disabled #brave-adblock-cookie-list-default flag and restarted the browser.
  • Visited brave://adblock and verified an entry for Easylist-Cookie List - Filter Obtrusive Cookie Notices is still checked
  • Visited brave://adblock and unchecked Easylist-Cookie List - Filter Obtrusive Cookie Notices
  • Visited brave://flags and enabled #brave-adblock-cookie-list-default flag and restarted the browser.
  • Visited https://digikey.com and confirmed cookie notice is displayed
1 2 3 4 5 6 7
1-Manual toggle - easylistcookie 2-flag enabled 3-cookienoticenolongerdisplayed 4 unchecked 5-flagdisabled 6 enabled 1-cookienotice

Note: In addition to above testing, verified Shields functionality works same as expected by comparing 1.37.x with1.36.x .

Read more comments on GitHub >

github_iconTop Results From Across the Web

A site still asks me to turn off AdBlock although it's allowlisted ...
The test the site is using to detect ad blockers is generating a false positive (less likely). Here are some troubleshooting steps to...
Read more >
find and replace firefox
Go to the search engine website you want to make your … ... Adblock is a popular adblocking tool, but it may reduce...
Read more >
Sea of Thieves ship battles How to win use cannons and ...
Always have your weapon fully loaded when you're on a ship in peacetime, ... Learn what to do in Sea of Thieves and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found