uBlockOrigin / uAssets

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

disqus.com: privacy #20066

Closed D4niloMR closed 1 year ago

D4niloMR commented 1 year ago

Prerequisites

URL address of the web page

https://disqus.com/home/inbox/

Category

privacy

Description

This isn't working anymore:

disqus.com##+js(href-sanitizer, a[href^="https://disq.us/url?url="][title^="http"], [title])

(See screenshot) Works to me:

disqus.com##+js(href-sanitizer, a[href^="https://disq.us/?url=http"], ?url)
disqus.com##a[href][data-link-out]:remove-attr(data-link-out)

I tested also with a new profile on Firefox.

Other extensions used

none

Screenshot(s)

Screenshot(s) ![image](https://github.com/uBlockOrigin/uAssets/assets/70459964/428f39f5-4db0-4179-ab77-3ea2f20155b4)

Configuration

```yaml uBlock Origin: 1.52.3b6 Chromium: 116 filterset (summary): network: 119923 cosmetic: 193351 scriptlet: 30141 html: 0 listset (total-discarded, last-updated): added: https://gitlab.com/magnolia1234/bypass-paywalls-clean-filters/-/raw/main/bpc-paywall-filter.txt: 958-0, 1h.47m https://raw.githubusercontent.com/DandelionSprout/adfilt/master/LegitimateURLShortener.txt: 2495-0, 1h.47m adguard-cookies: 27804-31, 1h.48m adguard-mobile-app-banners: 4656-9, 1h.48m adguard-other-annoyances: 13648-7, 1h.48m adguard-popup-overlays: 24589-64, 1h.48m adguard-social: 21880-921, 1h.47m adguard-widgets: 2317-4, 1h.47m easylist-annoyances: 3993-203, 1h.47m easylist-chat: 141-11, 1h.47m easylist-newsletters: 6537-424, 1h.47m easylist-notifications: 2712-1445, 1h.47m [5 lists not shown]: [too many] default: user-filters: 98-3, never easylist: 71726-70, 1h.50m easyprivacy: 33234-179, 1h.50m plowe-0: 3726-1070, 1h.50m spa-1: 5642-71, 1h.50m ublock-badware: 7297-134, 1h.50m ublock-filters: 34932-558, 1h.50m ublock-privacy: 559-53, 1h.50m ublock-quick-fixes: 236-97, 1h.50m ublock-unbreak: 2142-36, 1h.50m urlhaus-1: 12055-0, 1h.50m filterset (user): [array of 62 redacted] switchRuleset: added: [array of 1 redacted] userSettings: advancedUserEnabled: true suspendUntilListsAreLoaded: true hiddenSettings: userResourcesLocation: [redacted] supportStats: allReadyAfter: 780 ms (selfie) maxAssetCacheWait: 233 ms popupPanel: blocked: 14 network: disqus.com: 5 amazon-adsystem.com: 1 amplitude.com: 1 d2pjwyttpedx35.cloudfront.net: 1 doubleclick.net: 1 googletagmanager.com: 1 osano.com: 1 rfihub.net: 1 rubiconproject.com: 1 wknd.ai: 1 extended: ###adhesion ##.ad-slot-wrapper ##.ad__align ##div[data-role="motd-alert"] ##.ad__adh-wrapper ##[data-role="ad-content"] ##a[href="/home/explore/"] ##+js(href-sanitizer, a[href^="https://disq.us/url?url="][title^… ```
D4niloMR commented 1 year ago

That was fast!! Thank you

dimisa-RUAdList commented 1 year ago

@stephenhawk8054 Something wrong

http://disq.us/p/2vt2qs2

Screenshot(s) ![discus](https://github.com/uBlockOrigin/uAssets/assets/20126984/c8a935de-b112-4b8e-ad8d-fc31ed22415b)
stephenhawk8054 commented 1 year ago

Thanks, I overlooked that. Updated.

dimisa-RUAdList commented 1 year ago

@stephenhawk8054 Why here [title^="http"]? The scriptlet itself checks the validity of the link.

stephenhawk8054 commented 1 year ago

I just try to limit the number of elements via CSS first before it's feeded to js. Won't be different too much, just my habit of trying to optimize.

dimisa-RUAdList commented 1 year ago

In this case need: disqus.com##+js(href-sanitizer, a[href^="https://disq.us/"][href*="?url=http"]:not([title^="http"]), ?url)

stephenhawk8054 commented 1 year ago

Aren't these 2 cases already separated?

disqus.com##+js(href-sanitizer, a[href^="https://disq.us/url?url="][title^="http"], [title])
disqus.com##+js(href-sanitizer, a[href^="https://disq.us/?url=http"], ?url)

I don't think a[href^="https://disq.us/url?url="] can overlap with a[href^="https://disq.us/?url=http"]?

dimisa-RUAdList commented 1 year ago

Oh, well, yes.

D4niloMR commented 1 year ago

@stephenhawk8054 Hey, i think that this filter can be aprimorated for a very specific case, if the user send a non valid link.

~This can be seem at: http://disq.us/t/4jxcu1t~

https://github.com/uBlockOrigin/uAssets/assets/70459964/cbdfbb98-4408-489e-849c-2e192ffb8a2c

disqus.com##+js(href-sanitizer, a[href*="://disq.us/url?url="][title], [title])

The other one is not necessary.

stephenhawk8054 commented 1 year ago

If it's invalid, there's no point to rewrite it? As the "link" cannot connect to anywhere.

D4niloMR commented 1 year ago

If it's invalid, there's no point to rewrite it? As the "link" cannot connect to anywhere.

Makes sense, but the user is still going to Disqus redirector unnecessarily, considerating that this filter is in the privacy list, this is a point.

D4niloMR commented 10 months ago

I have encountered a working link which is not covered by the current filter.

http://disq.us/p/2vt3yeh

Although I'm not sure why but it does not works correctly with the filter I proposed https://github.com/uBlockOrigin/uAssets/issues/20066#issuecomment-1783984502

Filtered:

<a href="https://disqus.com/embed/comments/apnews.com" rel="nofollow noopener" title="apnews.com">apnews.com</a>

Not filtered:

<a href="http://disq.us/url?url=http%3A%2F%2Fapnews.com%3Ak6Or9PUqTwGOPpq728-qWPrvuaI&amp;cuid=1290197" rel="nofollow noopener" title="apnews.com">apnews.com</a>

stephenhawk8054 commented 9 months ago

Both links are http (without s), so the filter should be adjusted to a[href^="http"]. However with the second http, href-sanitizer won't work iirc from the code.

D4niloMR commented 9 months ago

I guess it's supposed to not work, the attribute to extract the link doesn't have https or http. The scriptlet is doing its job, but to work properly is necessary to add https at the start.

@gorhill