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

Facebook #3367

Open
GetGankNow opened this issue Aug 30, 2018 · 385 comments
Open

Facebook #3367

GetGankNow opened this issue Aug 30, 2018 · 385 comments

Comments

@GetGankNow
Copy link

@GetGankNow GetGankNow commented Aug 30, 2018

URL(s) where the issue occurs

Facebook.com

Describe the issue

The Facebook sponsored ads is appearing again, i have tried all the solutions but nothing works

Versions

  • Browser/version: [Chrome 68.0.3440.106]
  • uBlock Origin version: [1.16.18]

Settings

  • [Default]
@KiLL4FuNK
Copy link

@KiLL4FuNK KiLL4FuNK commented Aug 30, 2018

I see nothing Can it be adware?
you have to see what programs you installed any
check if you do not have some rare extensions

@GetGankNow
Copy link
Author

@GetGankNow GetGankNow commented Aug 31, 2018

No i don't have any adware or some adware extensions, the ads are from Facebook ( sponsored )

@mapx-
Copy link
Contributor

@mapx- mapx- commented Aug 31, 2018

While on a page with ads, right click on page, save as ..., you'll get a folder + html page, zip them together, upload the zip on some free server. Post here the link.

@GetGankNow
Copy link
Author

@GetGankNow GetGankNow commented Aug 31, 2018

Here the page with the sponsored ad: https://ufile.io/y827j

@mapx-
Copy link
Contributor

@mapx- mapx- commented Aug 31, 2018

@GetGankNow test this filter
facebook.com##.userContentWrapper :has([id^="feed_subtitle_"]:has-text(Sp))

@GetGankNow
Copy link
Author

@GetGankNow GetGankNow commented Aug 31, 2018

@mapx- is blocking all post but allowing the comment section and reaction section.

@mapx-
Copy link
Contributor

@mapx- mapx- commented Aug 31, 2018

facebook.com###substream_1:has([id^="feed_subtitle_"]:has-text(Sp))

@GetGankNow
Copy link
Author

@GetGankNow GetGankNow commented Aug 31, 2018

@mapx- works bro, thanks a lot.

@GetGankNow
Copy link
Author

@GetGankNow GetGankNow commented Aug 31, 2018

Edit: some sponsored ads are appearing again.

@mapx-
Copy link
Contributor

@mapx- mapx- commented Aug 31, 2018

another example page ?

@GetGankNow
Copy link
Author

@GetGankNow GetGankNow commented Aug 31, 2018

The page that i save include all ads, i don't know how to save the page without the ads of this: facebook.com###substream_1:has([id^="feed_subtitle_"]:has-text(Sp))

@GetGankNow
Copy link
Author

@GetGankNow GetGankNow commented Aug 31, 2018

facebook.zip
Here the page again.

@mapx-
Copy link
Contributor

@mapx- mapx- commented Sep 1, 2018

test

facebook.com##[id^=hyperfeed_story_id_]:has(a[href*="client_token"])
facebook.com##[id^=hyperfeed_story_id_]:has(a[href*="utm_campaign"])
@uBlockOrigin uBlockOrigin deleted a comment from adranger Sep 1, 2018
@GetGankNow
Copy link
Author

@GetGankNow GetGankNow commented Sep 1, 2018

@mapx- this 3 rules works. Thanks for all!!

@mapx- mapx- closed this in d1b91d6 Sep 1, 2018
ZaphodBeebblebrox added a commit that referenced this issue Sep 1, 2018
mapx- added a commit that referenced this issue Sep 6, 2018
@ghajini
Copy link
Contributor

@ghajini ghajini commented Sep 9, 2018

ads 'sponsored'

screenshot 41c

@mapx-
Copy link
Contributor

@mapx- mapx- commented Sep 9, 2018

test
facebook.com##[id^=hyperfeed_story_id_]:has([id^=u_fetchstream_2_1]:has-text(SpSonSsoSredS))
or
facebook.com##[id^=hyperfeed_story_id_]:has([id^=u_fetchstream_2_1]:has-text(Sp))

@ghajini
Copy link
Contributor

@ghajini ghajini commented Sep 9, 2018

not working bro
screenshot 42

@mapx-
Copy link
Contributor

@mapx- mapx- commented Sep 9, 2018

weird, working for me (exactly using your test-case)

Did you test the same case you uploaded ? or something new ? could be "they" are using different approaches

@shuhaowu
Copy link

@shuhaowu shuhaowu commented Sep 10, 2018

Doesn't work for me either. I had to use something like this:

facebook.com##[id^=hyperfeed_story_id_]:has([id^=feed_subtitle_]:has-text(SpSonSsoSredS))

However, with this filter active, FB seems to be refreshing the posts in an infinite loop.

@filbo
Copy link

@filbo filbo commented Sep 13, 2018

From about 3mo to about 2wk ago, it was possible to catch Sponsored posts with :has-text(SpSonSsoSredS). This appeared only in Sponsored posts, with the 'S' elements hidden by CSS. (I'm not sure about back then, but now, the hiding CSS uses 'font-size:0', not 'display:none'.)

About 2wk ago, they started putting that stuff into all(*) posts. In Sponsored posts they use CSS to hide the 'S' elements. In 'normal' posts they use CSS to hide all of this. :has-text() is not aware of CSS hiding. The CSS used for this hiding is cryptographically hashed; so far it has remained stable for me, but another user has completely different classes, so the simple selector I use in my own filter won't work for anyone else. So we have to get into runtime evaluation of CSS computed styles :(

[(*)Not really 'all', but all normal posts by users, and many Sponsored posts, although some emitted by other modules inside FB don't use this particular trickery.]

It seems like uBO :matches-css() [see: https://github.com/gorhill/uBlock/wiki/Procedural-cosmetic-filters] might be able to handle this. Something like:

facebook.com##[id^=hyperfeed_story_id_]:if([id^=feed_subtitle_] span:has-text(^Sp$):matches-css(:not(display:none)))

-- which is COMPLETELY UNTESTED, just a pile of syntax smashed together by hand. Not sure if the nested uBO selectors are supported...

And all they need to do to break this is chop the word 'Sponsored' up differently; and it won't work for other UI languages. This is getting ugly.

@kowith337
Copy link

@kowith337 kowith337 commented Sep 13, 2018

Maybe need to view the deep of they DOM tag, e.g. looking in data-ajaxify, data-sigil, data-uri, data-ft, data-xt, ...

for example, I've found some part of sponsored URLs have is_sponsored=1 parameter, sometime it's boxed the parameter like [is_sponsored]=1

@wtchangdm
Copy link

@wtchangdm wtchangdm commented Sep 13, 2018

Hi, I saw the comment in filters so I'd like report here:
I am not sure if is region-related, but the following rule is killing my timeline (using https://www.facebook.com/?sk=h_chr). All of the posts are hidden now.

facebook.com##[id^=hyperfeed_story_id_]:has([id^=feed_subtitle_]:has-text(SpSonSsoSredS))

Thanks.

mapx- added a commit that referenced this issue Sep 13, 2018
@stephen304
Copy link

@stephen304 stephen304 commented Oct 17, 2020

Are

facebook.com##div[data-pagelet*="FeedUnit"]:has(div[aria-label="Sponsored"])
facebook.com##div[data-pagelet*="FeedUnit"]:has-text(Suggested for You)

obsolete now?

Still working for me at least

I'm surprised it's still working, I was using these for almost a month before posting here. I wasn't sure if a FB employee watching this thread would immediately fix their mistake in obfuscation.

@krystian3w
Copy link
Contributor

@krystian3w krystian3w commented Oct 17, 2020

As long as it is not globally available on the list, they probably do not care.

@PIZZA90
Copy link

@PIZZA90 PIZZA90 commented Oct 17, 2020

the filter of kowith337 is working, changing /Sponsored/ for Publicidad in spanish version

in: https://www.facebook.com/marketplace i made this filter and is hiding the ads:

facebook.com##a[aria-label="Enlace del anunciante"] 😆

Example with filter and no filter in marketplace page
Captura

@Yuki2718
Copy link
Contributor

@Yuki2718 Yuki2718 commented Oct 18, 2020

@stephen304 Thx, probably I misinterpreted @krystian3w and @kowith337 's comments when they seem to discuss different ads.

@krystian3w
Copy link
Contributor

@krystian3w krystian3w commented Oct 18, 2020

Hompage =/= fb marketplace

@Yuki2718
Copy link
Contributor

@Yuki2718 Yuki2718 commented Oct 18, 2020

@krystian3w Sorry but can you confirm the Japanese translation of Sponsored in ##div[data-pagelet="RightRail"] div[class] h3[dir]:has(span[dir]:has-text(/Sponsored/)):upward(7) is 広告 too?

@krystian3w
Copy link
Contributor

@krystian3w krystian3w commented Oct 18, 2020

Yes: 広告

obraz

The advertisements do not match the interface language or IP from the VPN.

@Yuki2718
Copy link
Contributor

@Yuki2718 Yuki2718 commented Oct 18, 2020

Thx!

@krystian3w
Copy link
Contributor

@krystian3w krystian3w commented Oct 18, 2020

PS. marketplace mixed English and Japanese, header "Sponsored" not was translated to: 広告 ("Advert").

@TNTUP
Copy link

@TNTUP TNTUP commented Oct 19, 2020

Ads showing up in the middle of some videos (can only reproduce in the main feed, wasn't able to reproduce in the page's feed)

snip screenies)

Can confirm this on my side, seeing those ads in between videos. UBlock blocked these before, since last week they appeared. Guess I have to install another 3rd party extension to block them :/

@krystian3w
Copy link
Contributor

@krystian3w krystian3w commented Oct 19, 2020

Maybe AdGuard Base blocked mid-roll ads with +js( / redirect or simple block network filter:

subscribe: AdGuard Base for uBlock Origin

If Facebook use SSAI, uBO may no block this ads.

@momala454
Copy link

@momala454 momala454 commented Oct 20, 2020

ads are back on homepage

image
image

aria-label="Sponsorisé" (sponsored)

this works
facebook.com##div[data-pagelet^="FeedUnit_"]:has(a[aria-label="Sponsorisé"])

@Epse
Copy link

@Epse Epse commented Nov 10, 2020

I use this facebook.com##div[data-pagelet^="FeedUnit"]:has(a[aria-label="Sponsored"]), as the aria-label is localised. The a does have a semi-random href referring to a page with info about ads, so maybe that can be used

@stephen304
Copy link

@stephen304 stephen304 commented Nov 15, 2020

facebook.com##div[data-pagelet*="FeedUnit"]:has(div[aria-label="Sponsored"])

Stopped working for me so now I use

facebook.com##div[data-pagelet*="FeedUnit"]:has(span[aria-label="Sponsored"])

I'm keeping them both enabled since they seem pretty safe

@Epse
Copy link

@Epse Epse commented Nov 15, 2020

@stephen304
Copy link

@stephen304 stephen304 commented Nov 15, 2020

@Epse That's fine by me heh

@krystian3w
Copy link
Contributor

@krystian3w krystian3w commented Nov 15, 2020

even if it isn't been shown on your feed as an ad (such as from pages you follow)

One attrib [aria-label="Sponsored"] is embeded on all posts, so span maybe is a bait:

<span aria-label="Sponsored">
@Epse
Copy link

@Epse Epse commented Nov 15, 2020

@Plex001
Copy link

@Plex001 Plex001 commented Nov 26, 2020

Hello
I found something there. But the list is getting too big

www.facebook.com ## div: nth-of-type (2)> .sjgh65i0.l9j0dhe7.k4urcfbm.du4w35lb> .l9j0dhe7.du4w35lb

www.facebook.com ## div: nth-of-type (3)> .sjgh65i0.l9j0dhe7.k4urcfbm.du4w35lb> .l9j0dhe7.du4w35lb

www.facebook.com ## div: nth-of-type (7)> .sjgh65i0.l9j0dhe7.k4urcfbm.du4w35lb> .l9j0dhe7.du4w35lb

www.facebook.com ## div: nth-of-type (8)> .sjgh65i0.l9j0dhe7.k4urcfbm.du4w35lb> .l9j0dhe7.du4w35lb

div: nth-of-type (2)
the number changes because someone can do something.

@krystian3w
Copy link
Contributor

@krystian3w krystian3w commented Nov 26, 2020

No help - crap compressed CSS clasess, maybe not stable.


Also:

I suppose all posts have .sjgh65i0.l9j0dhe7.k4urcfbm.du4w35lb > .l9j0dhe7.du4w35lb

@Yuki2718
Copy link
Contributor

@Yuki2718 Yuki2718 commented Nov 26, 2020

Do not rely on picker-generated rules. Right-click on the ads, Inspect element, and take screenshots.

@stephen304
Copy link

@stephen304 stephen304 commented Dec 5, 2020

Through all the cat and mouse with facebook, this rule has continued to pay dividends 😆

facebook.com##div[data-pagelet*="FeedUnit"]:has-text("Many failed before. Will YOU complete the trial")
@spec1re
Copy link

@spec1re spec1re commented Dec 21, 2020

Hello, since few days facebook get flooded with Sponsored ads again, this rule do not work anymore:

# Anti Adblock facebook.com #3367
# https://github.com/uBlockOrigin/uAssets/issues/3367
facebook.com##div[data-pagelet^="FeedUnit_"]:has(a[aria-label="Gesponsert"])
facebook.com##div[data-pagelet^="FeedUnit_"]:has(a[aria-label="Sponsored"])
facebook.com##div[data-pagelet^="FeedUnit_"]:has(a[aria-label="Create ad"])

As looking for a solution for this issue, I found a chrome extension which works surprising well

https://chrome.google.com/webstore/detail/fblock-sponsored/njcnnfelhkehnacoabhefefkbmloakkf

Looking truh the sourcecode I found this:

/**
 * @file F.Block Sponsored 2.9.6
 * @copyright F.Block Sponsored 2020
 */
$(function(){let e=function(){let e,i=$(document),n=0;function t(e){0!==e.length&&(e.remove(),chrome.runtime.sendMessage({blockedCount:++n}))}if($("#MNewsFeed").length){let n='div[data-sigil="m-feed-voice-subtitle"] > :first-child:not(a)',o="article";function s(){t($(this).closest(o))}function d(){t($(this).not(":has(*)").closest(o))}return e="article > header",t($(n).closest(o)),t($(e).not(":has(*)")),i.unbindArrive(n,s),i.unbindArrive(e,d),i.arrive(n,s),void i.arrive(e,d)}let o='div[data-pagelet^="FeedUnit_"]',a='div[role="feed"] div .qzhwtbm6.knvmm38d > span > span[id]:not([class]) > a:nth-child(2)[role="link"]';function s(){const e=$(this).children();e.length&&t(e.eq(0).closest(o))}function d(){t($(this).not(":has(> a)").closest(o))}e='div[class="dati1w0a hv4rvrfc"] > div > div > div > span',t($(a).closest(o)),t($(e).not(":has(> a)").closest(o)),i.unbindArrive(a,s),i.unbindArrive(e,d),i.arrive(a,s),i.arrive(e,d)};e(),$(window).bind("hashchange",e)});

Can someone so kind and make a working rule from this for uBlock? So I don't relay on another extension to keep facebook clean.

Thanks!

@Yuki2718
Copy link
Contributor

@Yuki2718 Yuki2718 commented Dec 21, 2020

@spec1re See https://www.reddit.com/r/uBlockOrigin/comments/kejwbz/facebook_sponsored_posts/.

@spec1re
Copy link

@spec1re spec1re commented Dec 21, 2020

@Yuki2718

Thanks a bunch, works again!

@Dark-Yox
Copy link

@Dark-Yox Dark-Yox commented Feb 5, 2021

New ads under videos that pops up after some time.
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet