SlimSocial-for-Facebook
SlimSocial-for-Facebook copied to clipboard
Hide "suggested for you" posts and "you may like" cards
-
Suggested for you content. Would it be possible to hide these simply by checking if suggested for you keyword exists for a post ?
-
People you may know or groups you may know. Can these cards be detected and hidden ?
I think it can be easily implemented. Nice suggestions.
@diesel701
! Suggested for you
www.facebook.com##:is([aria-posinset],[aria-describedby]:not([aria-posinset])) div:not(:only-child)>div:only-child>div:only-child>div:first-child[class=""]>div:not([data-0]):has-text(/^Suggested/):upward([aria-posinset],[aria-describedby]:not([aria-posinset]))
! Unlabelled Suggested posts (with a Follow button)
www.facebook.com##:is([aria-posinset],[aria-describedby]:not([aria-posinset])) :is(h3,h4) [role=button]:has-text(Follow):upward([aria-posinset],[aria-describedby]:not([aria-posinset]))
! Use only if you actually have these: Suggested posts with the label next to the post date
www.facebook.com##:is([aria-posinset],[aria-describedby]:not([aria-posinset])):has-text(Suggested for you)
! People You May Know
www.facebook.com##:is([aria-posinset],[aria-describedby]:not([aria-posinset])) [aria-label="See all"][href="/friends/"]:upward([aria-posinset],[aria-describedby]:not([aria-posinset]))
! Suggested groups
www.facebook.com##:is([aria-posinset],[aria-describedby]:not([aria-posinset])) [aria-label="See more groups"][href="/groups/discover/"]:upward([aria-posinset],[aria-describedby]:not([aria-posinset]))
! Reels and short videos
www.facebook.com##:is([aria-posinset],[aria-describedby]:not([aria-posinset])) [aria-label="See more"][href="/reel/?s=ifu_see_more"]:upward([aria-posinset],[aria-describedby]:not([aria-posinset]))
! Suggested pages
www.facebook.com##:is([aria-posinset],[aria-describedby]:not([aria-posinset])) [aria-label="Suggested pages"]:upward([aria-posinset],[aria-describedby]:not([aria-posinset]))
---Mobile---
! Suggested for you (mobile)
m.facebook.com##[data-mcomponent="MScreen"]>div[class="m"]>div:has-text(Suggested for you)
these are working on ublock origin for me on desktop so maybe they can be adjusted for slimsocial?
@shamirahim111 I tried the last one for mobile with Firefox on Android but I got a glitchy behaviour of the scroll. Probably I will keep using SlimSocial with the "suggested" pages.
This would be a fantastic enhancement for a fantastic app.
Facebook changed its code so I can't intercept the ads anymore.
Let's see if we get help from this other dev: https://github.com/zbluebugz/facebook-clean-my-feeds/issues/66
Here's a snippet for hiding Sponsored posts on m.facebook.com:
function hideSponsoredPosts() {
// -- dictionary of words to detect - must be in regex format.
const DICTIONARY = new RegExp('Sponsored|Patrocinado|Gesponsert'.toLowerCase());
// -- get collection of posts:
posts = document.querySelectorAll('div[data-type="vscroller"] > div[data-mcomponent="MContainer"][data-tracking-duration-id]:not([hsp])');
// -- scan each post for "Sponsored"
posts.forEach( (post) => {
// -- get the <element> that has the post's date/time/<certain phrases>
const headerMeta = post.querySelector(':scope > div > div > div:nth-of-type(2) > div:last-of-type > div > span:first-of-type');
if (headerMeta !== null) {
// -- a typical post
if (DICTIONARY.test(headerMeta.innerText.toLowerCase())) {
// -- found a Sponsored post, hide it (do not remove - fb hates that!)
post.setAttribute('data-actual-height', '0');
post.style.height = '0';
post.setAttribute('hsp', 'Sponsored');
}
}
})
}
Thanks for sharing but unforutunatly this doesn't seem to work on touch.facebook.com :(
Is it possible to get a Windows10 browser to visit touch.facebook.com without being redirected to www.facebook.com?
Is it possible to get a Windows10 browser to visit touch.facebook.com without being redirected to www.facebook.com?
I guess you need to change the User Agent to a mobile one