Troubleshooting technical issues is much easier when both the user and support agent practice clear communication. For this reason, we have provided the template below for you to fill out with information about your issue. Please provide as much detail as possible so we can most efficiently resolve your problem.
Description of the issue:
Facebook shows sponsored post ads even if shields are set to aggressive.
How can this issue be reproduced?
Set mobile browser shields to aggressive
2.Load Facebook mobile site
Expected result:
Brave Version( check About Brave
):
1.34.81
Mobile Device details Android 11
Additional Information:
1 Like
This is because Brave currently doesn’t support procedural filtering
opened 07:40PM - 14 May 21 UTC
feature/shields/adblock
uBO-parity
OS/Desktop
## Description
Facebook displays "Sponsored" items on the main feed and in t… he side-bar, even when shields are configured to engage in _Aggressive_ blocking.
## Steps to Reproduce
Use Facebook, and look at the items in your feed and side-bar 🙂
## Actual result:
Items in the top-right:
![image](https://user-images.githubusercontent.com/815158/118320034-45f05c00-b4c1-11eb-8eae-cc5b7a4d97e4.png)
Items in the feed:
![image](https://user-images.githubusercontent.com/815158/118320096-5c96b300-b4c1-11eb-99a0-b2a76f2d94ef.png)
## Expected result:
Ads should not be shown when the user has engaged Aggressive blocking.
## Reproduces how often:
Easily.
## Brave version (brave://version info)
1.24.85
## Miscellaneous Information:
The DOM around _Sponsored_ content is designed to confuse queries. For example, the "Sponsored" string is constructed for numerous elements, interspersed with positioned elements throughout.
![sponsored-2](https://user-images.githubusercontent.com/815158/118320339-b7c8a580-b4c1-11eb-8dfe-be6ac8b5236c.PNG)
One approach would be to use a Mutation Observer to identify/excise ads. The following was constructed as a quick _proof of concept_. A clear limitation here would be the expectation that the string displayed to the user is in English. This is not likely to be the case for most users.
```js
// We expect the feed element to exist before proceeding
document.addEventListener( "DOMContentLoaded", () => {
// Hides a post if it has <span>o</span> or <span>Suggested for You</span>
// Posts have numerous spans, with 'Sponsored' broken up into chars
const removeSponsoredFeedItems = post => {
const nodes = post.querySelectorAll( "span:not([style])" ) || [];
const spans = [ ...nodes ];
spans.some( e =>
e.textContent === "o"||
e.textContent === "Suggested for You"
) && post.remove();
};
// Listens for new post elements in the feed
const observer = new MutationObserver( changes => {
for ( const change of changes )
for ( const node of change.addedNodes )
if ( node.parentElement.matches("[role='feed']") )
removeSponsoredFeedItems( node );
});
const feed = document.querySelector("[role='feed']");
const nodes = feed.querySelectorAll("[data-pagelet^='FeedUnit']");
const config = { childList: true, subtree: true };
// Processes first sponsored element in the page
nodes.forEach( removeSponsoredFeedItems );
// Processes any subsequent sponsored element in the page
observer.observe( document.documentElement, config );
});
```
2 Likes
Will it be something forthcoming in a future update?
1 Like
Yes, it’s on their TODO list
opened 10:21PM - 13 Jul 21 UTC
feature/shields/adblock
uBO-parity
OS/Android
features/shields/cosmetic-filtering
OS/Desktop
Procedural cosmetic filtering is useful for the most evasive kinds of in-content… sponsored/promoted material. It'd be great to implement this and tie it to aggressive shields settings, to handle the last few examples of cosmetic items slipping through on Reddit, YouTube, Facebook, etc.
See also:
- Reddit promoted content on mobile https://github.com/brave/brave-browser/issues/16789
- Facebook sponsored items https://github.com/brave/brave-browser/issues/15869
- YouTube empty video slots https://github.com/brave/brave-browser/issues/11955
2 Likes
Interesting, what is the filtering form then, with the YouTube banner ads, that used to show up - in mind?
Context: “Ads not blocked on YouTube.com”
1 Like
Stantard cosmetic filtering
Brave is releasing a new system for hiding unwanted, privacy harming page elements. These include empty page space caused by blocking trackers, and third-party ads that cannot be blocked at the network layer.
2 Likes
system
Closed
March 4, 2022, 10:12pm
8
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.