AdguardTeam / AdguardFilters

AdGuard Content Blocking Filters
https://adguard.com/
GNU General Public License v3.0
3.08k stars 621 forks source link

facebook.com #76210

Closed Morku closed 3 years ago

Morku commented 3 years ago

Issue URL (Annoyance)

https://www.facebook.com/

Comment

Username: @Morku

Cookie Pop-up

Die folgenden Informationen werden automatisch generiert. Bitte löschen Sie sie nicht. Custom userscripts: https://userscripts.adtidy.org/release/adguard-extra/1.0/adguard-extra.user.js

Screenshots

Screenshot-1: ![facebook](https://user-images.githubusercontent.com/6276915/109483295-57f45e00-7a7f-11eb-86a4-c14182b6613e.png)

### System configuration Information value AdGuard product: AdGuard for Windows v7.5.3 Browser: Firefox AdGuard driver: WFP Stealth mode options: Hide your search queries, Send Do-Not-Track header, Remove X-Client-Data header from HTTP requests, Strip URLs from tracking parameters Filters: Ad Blocking: AdGuard Mobile Ads, AdGuard Base Privacy: AdGuard Tracking Protection Social Widgets: AdGuard Social Media Annoyances: AdGuard Annoyances Language-specific: AdGuard Russian, AdGuard German
krystian3w commented 3 years ago

So no longer works: https://github.com/AdguardTeam/AdguardFilters/blob/d0a0131bb286cbaefb17e1a46f112eb9dc1d8e0a/AnnoyancesFilter/sections/cookies_specific.txt#L558

May need retest if scroll again gone: https://github.com/AdguardTeam/AdguardFilters/blob/d0a0131bb286cbaefb17e1a46f112eb9dc1d8e0a/AnnoyancesFilter/sections/cookies_specific.txt#L5313

AdamWr commented 3 years ago

@Morku Could you please check if one of these rules work:

facebook.com#$#div[data-testid="cookie-policy-dialog"] { display: none !important; }
facebook.com#$#div[data-testid="cookie-policy-banner"] { display: none !important; }

And if so, then could you please log in (if you have an account) and then check if there is another cookie notice and you can close it? This second cookie popup (when user is logged) shouldn't be blocked, because website requires to close/accept cookie notice, otherwise content will not load.

krystian3w commented 3 years ago

Logged users don't see any cookie policy pop-ups.

Log in = "accepted" cookie policy (rather facebook doesn't care that the Filter lists cuts out pop-up cookies).

AdamWr commented 3 years ago

If I'm not logged and I hide this cookie popup (I mean if I add this rule: facebook.com#$#div[data-testid="cookie-policy-dialog"] { display: none !important; }) and then log in, then I see a different cookie popup.

Screenshot ![image](https://user-images.githubusercontent.com/29142494/109817921-be6dad80-7c32-11eb-8396-4d523d5add45.png)
Morku commented 3 years ago

@AdamWr It's exactly the way you described. For the startpage the Cookie Pop-up is blocked. After I have Logged In, the Cookie Pop-up now appears there. I am able to close this Pop-up by accepting Cookie, but also be able to check settings first (Datenschutzeinstellungen verwalten) After accept, I can use Facebook without issue.

Screenshot-1: ![Unbenannt-1](https://user-images.githubusercontent.com/6276915/109818341-2e7c3380-7c33-11eb-9220-8023cb30a07b.jpg)

wout-codes commented 3 years ago

@AdamWr Isn't it possible to craft a JavaScript rule that would click the Accept button automatically?

krystian3w commented 3 years ago

Kiboke added click into own addon so possible create script if no break hide sponsored posts by MutationObserver or generate lags for other facebook script rules.

AdamWr commented 3 years ago

In case if user is not logged something like this should works:

facebook.com#%#AG_onLoad(function(){if(-1==document.cookie.indexOf("datr")){var a=new MutationObserver(function(){var b=document.querySelector('body.hasCookieBanner div[class][data-testid="cookie-policy-dialog"] button[data-cookiebanner="accept_button"]');b&&(a.disconnect(),b.click())});a.observe(document,{childList:!0,subtree:!0});setTimeout(function(){a.disconnect()},1E4)}});

For this cookie popup when user logged without accepting cookie notice a different rule is needed and I guess more complicated as names of classes/ids are random.

Morku commented 3 years ago

@AdamWr I can confirm that this works fine when I am not logged in before. If I am Logged In, but Cookie Pop-up is blocked, it is still there (normally, this shouldn't happen anyway, or?)

But for some reason, the broken block is added now and the ticket closed!???

wout-codes commented 3 years ago

@AdamWr I guess you should craft a more complicated JS Rule. I don't have any ideas right now.

krystian3w commented 3 years ago

For logged maybe ExtendedCSS?

#?#body > div[class*=" "]:nth-last-child(2):nth-last-of-type(2) span > a[href="/policies/cookies/"]:upward(body > div[class*=" "])

If hide too slow, maybe only scriptlets or JS script rules can hidde better.

AdamWr commented 3 years ago

If we accept a cookie notice before log in, then any other rule is not required, so I think that we do not need to create more "complicated" rules. Also we can't hide this cookie notice, because content will not load (I mean when user is logged).

Rule from this comment - https://github.com/AdguardTeam/AdguardFilters/issues/76210#issuecomment-789755437 shouldn't cause any issues, so I will add it.

krystian3w commented 3 years ago

Cookies and localStorage is obstruficated/unreadable for normal humans?

AdamWr commented 3 years ago

Yes, looks like random values.