easylist / easylist

EasyList filter subscription (EasyList, EasyPrivacy, EasyList Cookie, Fanboy's Social/Annoyances/Notifications Blocking List)
https://easylist.to
2.21k stars 717 forks source link

reddit.com (NSFW subreddits) #19150

Open jackrjli opened 4 months ago

jackrjli commented 4 months ago

List the website(s) you're having issues with:

https://www.reddit.com/r/NSFW411/ (or any other NSFW subreddit on reddit.com)

What happens?

When a user visits a NSFW subreddit via the desktop website and is not logged in, the site shows an overlay prompting the user to either log in or confirm they are over 18 to proceed, and blurs the page behind the overlay. When using the "EasyList – Notifications" list in uBlock Origin, the prompt is hidden but the blur remains, rendering the site unusable.

Additionally, if the user works around this (e.g. by disabling cosmetic filtering) and clicks "Yes, I'm over 18," the page reloads but the prompt reappears, sending the user into a loop.

Note: There is a different overlay for the mobile website that does not give the option of clicking "Yes, I'm over 18"; this overlay is a different element from the prompt on desktop. There is also a different dialog when visiting a NSFW subreddit from a Google search result (the subreddit contents aren't shown at all and it's just the prompt against a white background), so to reproduce the issue you should visit the site directly and not through a search result.

Screenshot(s)

desktopblur

Filter lists you're using:

EasyList – Notifications list in uBlock Origin

Your settings:

Other details:

The prompt is hidden by the rule reddit.com##shreddit-experience-tree. This was introduced in commit 29a56c2ff306048bf9a65b33a4f239c31fb52ffa, apparently to block the app prompt on the mobile site: mobileappprompt

This same rule is present in the "AdGuard – Mobile App Banners" list.

To show the NSFW prompt while still hiding the mobile app banner, the rule could be changed to either:

reddit.com##shreddit-experience-tree:matches-attr(active-experiences='["app_selector"]')

or

reddit.com##shreddit-experience-tree:not(:matches-attr(active-experiences='["nsfw_bypassable"]'))

the former to block the mobile app banner specifically, or the latter to block all "shreddit-experience-tree" elements except the NSFW prompt.

The NSFW overlay shows a QR code linking the mobile app in addition to the prompt itself: desktopqrcode

To block this specifically, you can use the filter:

reddit.com###nsfw-qr-dialog

The loop (in which clicking "Yes, I'm over 18" doesn't get rid of the prompt) is caused by the filter reddit.com##+js(set-local-storage-item, xpromo-consolidation, 1): https://github.com/easylist/easylist/blob/e986df92c127765772ca0f1314c137e5b5c8695e/fanboy-addon/fanboy_notifications_specific_uBO.txt#L32 Disabling this rule (reddit.com#@#+js(set-local-storage-item, xpromo-consolidation, 1)) makes the button work again.

If you would rather get rid of the NSFW prompt entirely (on desktop), you can use reddit.com##shreddit-experience-tree:remove(). Just hiding the page blur (reddit.com##body > div) doesn't work because the "View NSFW content" button on each post doesn't appear until you click through the prompt, but removing the "shreddit-experience-tree" element (as opposed to hiding it) triggers the page blur to go away and the buttons to reappear.

jackrjli commented 4 months ago

I just did some more testing and found that disabling the reddit.com##+js(set-local-storage-item, xpromo-consolidation, 1) rule while leaving the reddit.com##shreddit-experience-tree rule as is makes the blur show up on the first page load but then disappear on reload. So that rule seems to me to be the more breaking of the two.