-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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 a block this element feature to the brave-extension (cosmetic adblock filters) #94
Comments
This is the only thing that's preventing me from using Brave as my default browser as I use this to remove social media annoyances (who to follow/friend, trending, etc.). I also hope that the blocked elements will be able to be synced to the cloud; so when we have to reinstall Brave we don't have to re-block the elements we blocked before. |
Something to keep in mind: the things you block on desktop may be different from the things you block on mobile. From a design standpoint, the ad placements (or whatever you desire to block) may also be located in different locations (leading to different CSS selectors, xpaths, etc). I don't plan to solve that in the first release as there is not a simple, elegant solution. cc: @DVSlayer42 |
@Snuupy How are we blocking? Do we plan to inject a custom style element with rules that target the element(s)? |
The current code will inject custom user style sheets. This is just a A benefit to doing it via CSS is that any element that triggers the filter list will be blocked, regardless of when it actually loads (via fetch/ajax calls since many ads are 3rd party hosted). Unfortunately, in-line styles always have priority over user-style sheets. There are 2 ways to fix this problem:
As a note, uBO uses the DOM watcher model, and I think that's the right direction to take this. I understand there will be some overhead, but this will allow for faster iteration and better web compatibility. Changing of how the browser renders pages is definitely a much larger change than writing javascript that operates on top of a page. |
Would it be possible to simply build in uBlock? At least as a temporary fix while a first party solution is being developed? Possibly a sub branch of the main code? |
That wouldn't lead to the best UX. Particularly we have a faster way to do network filtering because we never leave the IO thread and our engine is in C++. |
I see, thank you for the input and best of luck with the project. Once it's out you'll certainly have me as a permanent user! |
Is there a commit so we can cherry pick the code? |
@Snuupy thanks, code looks good with comments in PR. However cant cherry pick due ot restricted access to branch. Looking forward to a merge. |
This has landed so closing. |
Verification Passed on
Verified passed with
|
I realize this is overdue, but I wanted to write down my notes here to capture the future features/roadmap in this issue. This is in no particular order, but is aimed to be a comprehensive to do list for the cosmetic filter feature. I'd be happy to put this in a new issue if that'll fit better in terms of organization. To do:
|
Is there a way we could have a feature similar to uBO where one could visually select the element they want to remove from the page? Exactly how uBO's element picker mode works. I feel that is a lot more easy to use than finding the correct CSS selector. A casual user might not know anything about CSS selectors but a visual way to block an annoying element would allow them to make use of this feature. Also it is hard to pinpoint exactly which CSS selector would result in the desired element to be blocked properly. A visual tool would take care of all of these limitations/shortcomings. |
@mihirkumar yes, @bsclifton and @Snuupy will want to post issues for @Snuupy and your suggestions above |
The intention here would be for users to be able to block elements on a given page and basically have those elements hidden or removed.
Milestones
Unit Tests Progress
chrome.storage.localTaking this to the next level
After this functionality is up and running, we can create a new issue for altering the behavior. For example, we might want to show a red box around the item that's selected and have the user acknowledge they would like to add a rule. Perhaps they could change the selector. That work should be captured in a different issue
We will also need a page where the rules can be visible (ex. about:adblock) and perhaps editable (possibly broken down by domain). That work should be captured in a different issue
The text was updated successfully, but these errors were encountered: