-
Notifications
You must be signed in to change notification settings - Fork 878
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add default filter provider manager #18876
Add default filter provider manager #18876
Conversation
695c03e
to
0fc5447
Compare
Register ComponentFiltersProvider with this
50a9ddc
to
5376206
Compare
|
||
// PostTask so this has an async return to match other loaders | ||
base::SingleThreadTaskRunner::GetCurrentDefault()->PostTask( | ||
FROM_HERE, base::BindOnce(std::move(cb), false, std::move(buffer))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
->LoadDATBufferForEngine( | ||
adblock_engine_->IsDefaultEngine(), | ||
base::BindOnce(&AdBlockService::SourceProviderObserver::OnDATLoaded, | ||
weak_factory_.GetWeakPtr())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
} else { | ||
filters_provider_->LoadDAT( | ||
base::BindOnce(&AdBlockService::SourceProviderObserver::OnDATLoaded, | ||
weak_factory_.GetWeakPtr())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
->LoadDATBufferForEngine( | ||
adblock_engine_->IsDefaultEngine(), | ||
base::BindOnce(&AdBlockService::SourceProviderObserver::OnDATLoaded, | ||
weak_factory_.GetWeakPtr())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
} else { | ||
filters_provider_->LoadDAT( | ||
base::BindOnce(&AdBlockService::SourceProviderObserver::OnDATLoaded, | ||
weak_factory_.GetWeakPtr())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resolves brave/brave-browser#30996
If Localhost Permission feature is ON,
$badfilter
localhost adblock rules. This way, clients always get localhost protections, even as we slowly roll out Localhost Permission feature.Also included in this PR: adblock engine/filter providers refactoring.
Submitter Checklist:
QA/Yes
orQA/No
;release-notes/include
orrelease-notes/exclude
;OS/...
) to the associated issuenpm run test -- brave_browser_tests
,npm run test -- brave_unit_tests
wikinpm run lint
,npm run presubmit
wiki,npm run gn_check
,npm run tslint
git rebase master
(if needed)Reviewer Checklist:
gn
After-merge Checklist:
changes has landed on
Test Plan:
With brave://flags/#brave-localhost-access-permission on, you should not see anything blocked on https://shivankaul.com/brave/localhost/subresource.html (i.e. no
1
on Shields).With the flag off, you should see it. This is because with the flag off, we inject the localhost blocking adblock rules, while we don't if the flag is on.
After this change, you don't need to add any exception adblock filter rules to test the localhost permission feature. Test plan from #17321 (comment) can be followed without the need to add the
@@||localhost^$domain=shivankaul.com
filter rule.shivankaul.com
still needs to be allowlisted locally -- see #18354 (comment) for how to do that.