uBlockOrigin / uAssets

Resources for uBlock Origin, uMatrix: static filter lists, ready-to-use rulesets, etc.
GNU General Public License v3.0
4.17k stars 774 forks source link

instagram.com: ads #14370

Closed sexymoomin closed 2 years ago

sexymoomin commented 2 years ago

Prerequisites

URL address of the web page

https://www.instagram.com/

Category

ads

Describe the issue

Saw ads

Screenshot(s)

Screenshot(s)

Configuration

```yaml uBlock Origin: 1.43.0 Firefox Mobile: 103 filterset (summary): network: 81393 cosmetic: 26932 scriptlet: 17627 html: 725 listset (total-discarded, last updated): default: user-filters: 0-0, never ublock-filters: 33200-310, 20h.30m ublock-badware: 4179-0, 18h.39m ublock-privacy: 247-1, 4d.21h.28m ublock-abuse: 76-0, 4d.21h.27m ublock-unbreak: 1872-0, 4h.15m ublock-quick-fixes: 360-1, 1d.2h.51m adguard-mobile: 8085-168, 20h.40m easylist: 69309-25114, 3d.1h.16m easyprivacy: 27306-591, 3d.1h.15m urlhaus-1: 4761-0, 18h.38m plowe-0: 3640-3, 9d.1h filterset (user): [empty] modifiedUserSettings: [none] modifiedHiddenSettings: [none] supportStats: allReadyAfter: 747 ms maxAssetCacheWait: 265 ms popupPanel: blocked: 28 blockedDetails: instagram.com: 28 ```
MasterKia commented 2 years ago

Saw ads

Screenshot?

krystian3w commented 2 years ago

Or save Dom tree to create ExtendedCSS (procedural) filter.

MasterKia commented 2 years ago

https://reddit.com/r/uBlockOrigin/comments/wmnwhf/ads_going_through_ublock_on_instagram_desktop/

krystian3w commented 2 years ago

Language specific, not everyone like English e.g. Italian 🇮🇹 or Spaniard / Spanish 🇪🇸.

MasterKia commented 2 years ago

https://reddit.com/r/uBlockOrigin/comments/wmnwhf/ads_going_through_ublock_on_instagram_desktop/

A) instagram.com##article div:has-text(/Sponsored/i):upward(article)

B) instagram.com##article div:has-text(/Sponsored/i):upward(article > div)

C) instagram.com##article > div > div > div > header > div:nth-of-type(2) > div:nth-of-type(2) > div > div > span:has-text(/Sponsored/i):upward(article > div)

krystian3w commented 2 years ago

IMO c to avoid match posts with lament to other influences with too much sponsored posts.

okiehsch commented 2 years ago

@MasterKia Are we sure that does not break anything, if that's the case add them.

I don't know much about it but could that not also hide some influencer instagram posts?

MasterKia commented 2 years ago

AdGuard hasn't got any reports about instagram.com sponsored posts in the recent months: https://github.com/AdguardTeam/AdguardFilters/issues?q=instagram.com

So I think we should wait and see if there are more reports about this in uAssets then we could add one of these filters.

krystian3w commented 2 years ago

Have here https://github.com/AdguardTeam/AdguardFilters/issues/123556 (first and last two @adguard-bot reports form 4 / 2 days ago and Alex 302 wrote suggestion).

BruhMomient commented 2 years ago

Have seen sponsored posts on the timeline, I'm assuming that's what OP is talking about? Here's a screenshot. instagram ad

BruhMomient commented 2 years ago

Have seen sponsored posts on the timeline, I'm assuming that's what OP is talking about? Here's a screenshot. instagram ad

Here's my config info also

```yaml uBlock Origin: 1.44.0 Firefox: 102 filterset (summary): network: 176720 cosmetic: 120068 scriptlet: 32230 html: 725 listset (total-discarded, last updated): added: https://winhelp2002.mvps.org/hosts.txt: 8730-342, 7m adguard-generic: 67014-5404, 8m adguard-mobile: 8149-210, 8m adguard-spyware: 26458-1371, 8m adguard-spyware-url: 713-2, 7m curben-phishing: 42401-7, 7m curben-pup: 189-0, 7m fanboy-cookiemonster: 39981-86, 7m dpollock-0: 11381-1635, 7m default: user-filters: 0-0, never ublock-filters: 33202-69, 8m ublock-badware: 4237-0, 8m ublock-privacy: 247-0, 8m ublock-abuse: 76-0, 8m ublock-unbreak: 1872-1, 8m easylist: 69556-1023, 8m easyprivacy: 27354-9918, 7m urlhaus-1: 4828-0, 7m plowe-0: 3635-3, 7m filterset (user): [empty] trustedset: added: [array of 5 redacted] switchRuleset: added: [array of 1 redacted] modifiedUserSettings: [none] modifiedHiddenSettings: [none] supportStats: allReadyAfter: 1585 ms (selfie) maxAssetCacheWait: 1057 ms popupPanel: blocked: 210 blockedDetails: instagram.com: 210 ```
MasterKia commented 2 years ago

@BruhMomient

Add these to "My filters" one by one and tell us which one (A, B or C) removes the sponsored posts: https://github.com/uBlockOrigin/uAssets/issues/14370#issuecomment-1217524472

krystian3w commented 2 years ago

And if it blinks after scrolling then use Alex 302 suggestion with split to two filters:

instagram.com##main > section div[style^="flex-direction: column;"] > article > div:has(span:contains(Sponsored)):style(visibility: hidden !important;)

Or

instagram.com##main > section div[style^="flex-direction: column;"] > article > div:has(span:contains(Sponsored))

MasterKia commented 2 years ago

@okiehsch AdGuard fixed it: https://github.com/AdguardTeam/AdguardFilters/commit/6b57f3cb433175b73eadd044fd1ff47a323bb629

Should we add the same?

okiehsch commented 2 years ago

Ok.

MasterKia commented 2 years ago

I'm uncertain to add the "Sponsored" translated in Russian (/Спонсор публикации:|Sponsored/))

okiehsch commented 2 years ago

Yeah, let's keep it english only for now.

krystian3w commented 2 years ago

Maybe AdGuard Addons again disabled use:

tabs.insertCSS() / scripting.insertCSS()

Then hidding works bad on pages. Apps no support WebExtension API at all, then works similar like addon without this API.

Yuki2718 commented 2 years ago

@MasterKia :contains() is AG syntax.

MasterKia commented 2 years ago

https://github.com/uBlockOrigin/uAssets/commit/070ccff059cdd58085c7f6b28be305957f5ff950

MasterKia commented 2 years ago

@krystian3w Why the dislike?

krystian3w commented 2 years ago

These change should be confirmed from devtools about lag/delay in hide elements or ate too many RAM at start browser or forced update list.

MasterKia commented 2 years ago

AFAIK uBO will internally change the compatible syntax at filter list compile time.

krystian3w commented 2 years ago

This looks strange for conversion:

https://github.com/uBlockOrigin/uBlock-issues/issues/2228

So it must be on a "strange" level that the error is not in EL syntax and deprecated :if(.

So if posts back in Chrome 105 (now served as stable) then needed is jump to development built.

calvinthefreak commented 1 year ago

Sadly Instagrams Adblocking breaks if you set instagram to any other Language then English...

in the German Version the "sponsored" text is "Gesponsert" and sadly thus the Ads show up...

MasterKia commented 1 year ago

Does this work for you?

instagram.com#?#main > div > section div[style*="flex-direction: column;"] > article > div:has(span:has-text(/Gesponsert/)):style(visibility: hidden !important;)
instagram.com#?#main > div > section div[style*="flex-direction: column;"] > article > div:has(span:has-text(/Gesponsert/))
Yuki2718 commented 1 year ago

https://github.com/AdguardTeam/AdguardFilters/issues/138429

calvinthefreak commented 1 year ago

@MasterKia Yes, I added those rules my self, works, just wanted to check this for few Hours until answering here, but I think, that this rules should be added too.

MasterKia commented 1 year ago

AdguardTeam/AdguardFilters#138429

But that bad filter is different from the one being discussed here.

krystian3w commented 1 year ago

Also possible spend time to create path inside :has(:

:has(> foo > bar > don-t > longer > touch-comments > span:has-text(Un anuncio muy molesta))
Yuki2718 commented 1 year ago

But that bad filter is different from the one being discussed here.

Okay, confirmed the rule doesn't have the problem.

MasterKia commented 1 year ago

Added.

Yuki2718 commented 1 year ago

Maybe all the language? /Gesponsert|Sponsored|Geborg|Sponzorováno|Sponsoreret|Χορηγούμενη|Publicidad|Sponsoroitu|Sponsorisé|Bersponsor|Sponsorizzato|広告|광고|Ditaja|Sponset|Gesponsord|Sponsorowane|Patrocinado|Реклама|Sponsrad|ได้รับการสนับสนุน|May Sponsor|Sponsorlu|赞助内容|贊助|প্রযোজিত|પ્રાયોજિત|स्पॉन्सर्ड|Sponzorirano|ಪ್ರಾಯೋಜಿತ|സ്‌പോൺസർ ചെയ്‌തത്|पुरस्‍कृत|प्रायोजित|ਪ੍ਰਾਯੋਜਿਤ|මුදල් ගෙවා ප්‍රචාරය කරන ලදි|Sponzorované|விளம்பரதாரர்கள்|స్పాన్సర్ చేసింది|Được tài trợ|Спонсорирано|Commandité|Sponsorizat|Спонзорисано/ But I can't reproduce.

MasterKia commented 1 year ago

Good idea. Do you think the #?# is needed? instagram.com#?#main > div > section div[style*="flex-direction: column;"] > article > div:has(span:has-text(...))

Yuki2718 commented 1 year ago

Do you think the #?# is needed?

Don't know but it's safer to have it.

krystian3w commented 1 year ago

CSSTree omit/ignore ?, this was experimental fallback to force JavaScript implementation :has( instead native from Chrome 105+ for simple filters.