Closed D4niloMR closed 1 year ago
That was fast!! Thank you
@stephenhawk8054 Something wrong
http://disq.us/p/2vt2qs2
Thanks, I overlooked that. Updated.
@stephenhawk8054
Why here [title^="http"]
? The scriptlet itself checks the validity of the link.
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.
In this case need:
disqus.com##+js(href-sanitizer, a[href^="https://disq.us/"][href*="?url=http"]:not([title^="http"]), ?url)
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"]
?
Oh, well, yes.
@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.
If it's invalid, there's no point to rewrite it? As the "link" cannot connect to anywhere.
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.
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&cuid=1290197" rel="nofollow noopener" title="apnews.com">apnews.com</a>
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.
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
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:
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