-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Prevent empty selectors from being migrated from legacy cosmetic filters #14763
Comments
Verified
Verified the following cases: MigrationUsing a previous browser version (
I added
Then, testing the same profile after the version upgrade:
Verified there are no empty filter-rule sets in
Verified that previously blocked elements are still blocked
Adding new filtersJust on
Verified there are no empty filter-rule sets in
Reference images (no blocked items)
Verification passed on
Migration Installed Visit a website of your choice (
Upgrade the profile to
Verified there are no empty filter-rule sets in brave://adblock
Verified that previously blocked elements are still blocked
Adding new filters Clean profile Opened brave://adblock and ensured new line has been added corresponding to the newly blocked items for cnn.com ensured that no new lines are created in brave://adblock: closing the prompt window, pressing cancel on the prompt window, and pressing OK with an empty rule in the prompt window Verified passed with
Verified test plan from brave/brave-core#8156 (comment) Migration (Upgrade)Using a previous browser version (I used
I added:
Then, testing the same profile after the upgrade (
brave://adblock comparison before and after upgrade
Site comparison before and after upgrade
Just adding new filters (Clean profile)
|
Test plan
See brave/brave-core#8270
Description
Followup to #9581
As visible in #9581 (comment), migrating the legacy cosmetic filtering implementation to the
brave://adblock
"Custom filters" box results in some invalid rules that have no CSS selector.This appears to be caused by the logic for retrieving the selector from
window.prompt
- a fallback to an empty string is used, even though no rule should be generated if an empty selector is passed, or if the prompt is closed rather than submitted.This should be fixed by updating the prompt to
trim
whitespace from the selector, and only adding the rule if it is non-empty. Additionally, any filters migrated from the legacy implementation should be ignored if the selector is blank.The text was updated successfully, but these errors were encountered: