Closed Morku closed 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
@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.
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).
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.
@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.
@AdamWr Isn't it possible to craft a JavaScript rule that would click the Accept button automatically?
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.
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.
@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!???
@AdamWr I guess you should craft a more complicated JS Rule. I don't have any ideas right now.
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.
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.
Cookies and localStorage is obstruficated/unreadable for normal humans?
Yes, looks like random values.
Issue URL (Annoyance)
https://www.facebook.com/
Comment
Username: @Morku
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