Skip to content
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

Custom adblock rules should allow cosmetic filters #4348

Closed
srirambv opened this issue May 8, 2019 · 17 comments · Fixed by brave/brave-core#3121 or brave/brave-core#4700
Closed

Custom adblock rules should allow cosmetic filters #4348

srirambv opened this issue May 8, 2019 · 17 comments · Fixed by brave/brave-core#3121 or brave/brave-core#4700

Comments

@srirambv
Copy link
Contributor

srirambv commented May 8, 2019

Test plan

See brave/brave-core#4700

Description

Custom adblock rules doesn't work

Steps to Reproduce

  1. Install 0.64.x build
  2. Add a custom rule for a site in brave://adblock
  3. Visit the page for which the custom rule was added, doesn't block
    [Detailed STR on https://github.com/fix cosmetic filtering brave-core#3121]

Actual result:

Custom adblock rule doesn't work. Element is still loaded after adding the rule

Expected result:

Should block elements based on custom rule

Reproduces how often:

Easy

Brave version (brave://version info)

Brave 0.64.72 Chromium: 74.0.3729.131 (Official Build) beta(64-bit)
Revision 518a41c1fa7ce1c8bb5e22346e82e42b4d76a96f-refs/branch-heads/3729@{#954}
OS Linux

Version/Channel Information:

  • Can you reproduce this issue with the current release?
    N/A
  • Can you reproduce this issue with the beta channel?
    Yes
  • Can you reproduce this issue with the dev channel?
    Yes
  • Can you reproduce this issue with the nightly channel?
    Yes

Other Additional Information:

  • Does the issue resolve itself when disabling Brave Shields?
    N/A
  • Does the issue resolve itself when disabling Brave Rewards?
    N/A
  • Is the issue reproducible on the latest version of Chrome?
    N/A

Miscellaneous Information:

Context menu CSS blocker works fine but isn't always blocking the right element.
This didnt work on muon as well brave/browser-laptop#12308
cc: @emerick

@rebron
Copy link
Collaborator

rebron commented May 10, 2019

cc: @Snuupy can you take a look?

@Brave-Matt
Copy link

+1 also encountering this

@emerick
Copy link
Contributor

emerick commented May 23, 2019

@srirambv Can you provide one or more sample rules that don't work and/or screenshots?

@srirambv
Copy link
Contributor Author

@emerick Here's the screenshot on latest nightly. I've added the custom adblock rule ##.header-ad using element class name. Even after adding the rule and clean reload of the page/relaunch of browser the ad doesn't get blocked.

Screenshot from 2019-05-27 13-19-38
Screenshot from 2019-05-27 13-19-43

Brave 0.67.62 Chromium: 75.0.3770.38 (Official Build)nightly (64-bit)
Revision 3860105745f2b12537da9e9f048f14c3f52ba970-refs/branch-heads/3770@{#618}
OS Linux

cc: @snyderp

@bbondy
Copy link
Member

bbondy commented May 28, 2019

I think maybe the title should say custom adblock filters should allow you to add cosmetic filters?

@srirambv srirambv changed the title Custom adblock rules doesn't work Custom adblock rules should allow cosmetic filters May 29, 2019
@tbergeron
Copy link

tbergeron commented Jun 2, 2019

So the way I understand it, there's currently NO way of blocking any custom element using UI nor the custom filters in brave://adblock right?

If you need another example, just try blocking ANYTHING on reddit. It just don't work at all.

I tried:

reddit.com##.promotedlink
reddit.com#?#div.promotedlink
reddit.com#?#.size-compact.Post:-abp-has([class*=promoted])

Version 0.64.77 Chromium: 74.0.3729.169 (Official Build) (64-bit) on Linux.
With JavaScript turned OFF by default (Reddit IS white-listed)

@bsclifton
Copy link
Member

@tbergeron that is correct - there is currently no way to block UI elements

@Snuupy is working through several issues related to UI element blocking which are tracked here:
https://github.com/brave/brave-browser/projects/21

@srirambv
Copy link
Contributor Author

cc: @ryanbr

@pes10k
Copy link
Contributor

pes10k commented Jun 12, 2019

This is not really in @ryanbr's purview at the moment, since we don't have the ability to apply cosmetic filters at all, and @ryanbr is working on improving issues with existing adblocking capabilities.

Hopefully we'll have this worked out over the summer though, with @Snuupy 's work or someone else who will be joining us for the summer

@petemill
Copy link
Member

petemill commented Aug 9, 2019

Fixed via brave/brave-core#3121

@srirambv
Copy link
Contributor Author

srirambv commented Sep 30, 2019

@btlechowski verified custom rules are not blocking elements. Verified on

Brave 0.69.130 Chromium: 77.0.3865.90 (Official Build) (64-bit)
Revision 58c425ba843df2918d9d4b409331972646c393dd-refs/branch-heads/3865@{#830}
OS Linux

@bsclifton
Copy link
Member

bsclifton commented Oct 1, 2019

I don't think this issue was actually addressed with brave/brave-core#3121

This issue is covering the brave://adblock page and being able to add cosmetic filters there; the PR was updating functionality in the right click menu

Re-opening and removing milestone

@bsclifton bsclifton reopened this Oct 1, 2019
@bsclifton bsclifton removed this from the 0.69.x - Release milestone Oct 1, 2019
@yousefamar
Copy link

After scratching my head over why my filters weren't working, I finally found this issue. It looks like the project this issue was added to (https://github.com/brave/brave-browser/projects/21) has been closed. Does this mean that there are no plans to make the box in brave://adblock do anything? If so, shouldn't it be removed so others can avoid the confusion I went through? And does this mean that the only way to add custom filters is by installing a 3rd party extension?

@pes10k
Copy link
Contributor

pes10k commented Nov 22, 2019

@yousefamar currently that field works for network rules, not cosmetic rules. However, once this lands you can enable cosmetic rules behind a flag too

brave/brave-core#3303

After that gets tested we will start exploring ways we can enable cosmetic blocking by default

@bsclifton
Copy link
Member

Updated to 1.7 because brave/brave-core#4772 hasn't been merged (yet). Updating the milestone back to 1.6 is in the post-merge checklist for uplifts

@kjozwiak kjozwiak modified the milestones: 1.7.x - Nightly, 1.6.x - Dev Mar 3, 2020
@bbondy bbondy modified the milestones: 1.6.x - Beta, 1.7.x - Dev Mar 10, 2020
@srirambv
Copy link
Contributor Author

srirambv commented Apr 2, 2020

Verification passed on

Brave 1.7.82 Chromium: 80.0.3987.162 (Official Build) dev (64-bit)
Revision f2c5dd6138153bb0658091205bd1a1717f16081a-refs/branch-heads/3987@{#1034}
OS Windows 10 OS Version 1803 (Build 17134.523)

Verified passed with

Brave 1.7.86 Chromium: 80.0.3987.163 (Official Build) (64-bit)
Revision e7fbe071abe9328cdce4ffedac9822435fbd3656-refs/branch-heads/3987@{#1037}
OS macOS Version 10.14.6 (Build 18G3020)

Verified passed with

Brave 1.7.86 Chromium: 80.0.3987.163 (Official Build) (64-bit)
Revision e7fbe071abe9328cdce4ffedac9822435fbd3656-refs/branch-heads/3987@{#1037}
OS Ubuntu 18.04 LTS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment