-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Anti-redirect scriptlet for vk.com (href-sanitizer) #2531
Comments
Your request is the equivalent of asking uBO to deal with redirect link, something which I have declined in the past, see #1784. Clear URLs is the right tool for this. |
The thing is, ClearURLs doesn't solve the problem on this site. The transition is still done via |
If it doesn't work with ClearURLs then maybe it's best to report the issue on their repo? |
Thanks, but I thought it might be possible to solve this problem with uBO. At the moment, almost all such tasks on Russian sites are solved by the Counters filter. However, the current features of uBO do not allow me to do the same for |
I prefer to decline, as explained in these similar requests:
Adding a scriptlet for this one particular case, beside that |
@dimisa-RUAdList What about using that userscript in the |
@MasterKia @gorhill I think it is possible to create a solution that will be adequate and useful for many cases, although not for all. I propose to create a scriptlet to modify the value of the href attribute. Its only function will be to replace the original href value with its text value. Universal. No complicated and risky redirects, no additions, absolutely transparent, using only what already exists in the original layout. Example: Target: Solution: |
Sounds similar to #2347. |
uBO has a built-in url sanitiser deployed when the document request is blocked. So add |
@uBlock-user For now, I'd rather wait for a response from Gorhill. |
^^^ If that's how you feel about it, but Strict Blocking as a feature has been present in uBO for years and nobody removes uBO because of it, just so you know. |
@uBlock-user However, its infrequent triggers are not at all the same as a constant trigger on every external transition on one of the most visited Russian sites. Do not be offended, but I have no purpose to continue the discussion of the solution you proposed. I'm just waiting for a response from Gorhill. |
Related issue: - uBlockOrigin/uBlock-issues#2531 Usage: example.com##+js(href-from-text, a[href^="/tracker-link?to="] The above scriptlet will find all elements matching the selector passed as 1st argument, and replace the `href` attribute with the text content of the element, if all the following conditions are met: - The element is a link (`a`) element - The link element has an existing `href` attribute - The text content of the element is a valid `https`-based URL
I added a Having more than one use case for such scriptlet, especially both from high traffic sites, is enough from me to want to try this -- let's just consider it experimental at this point in case there are serious issues with using such scriptlets identified later. So for your use case, this filter works:
For Twitter, this works:
|
To fix YouTube tracking user clicks of the video description links, I tried:
It works; but when I click on the description link, YouTube opens the previous link with the help of a Example: Added to wiki: https://github.com/uBlockOrigin/uBlock-issues/wiki/Resources-Library#href-from-textjs- |
That case is Youtube warning that you are leaving the site, so it's not done silently, and because of this I would rather that we do not bypass these warnings. |
@gorhill That warning only appears if the tracking parameters are removed, something which the So if you visit: It will silently redirect you to But if you add these to remove the tracking parameters: ||youtube.com/redirect?$removeparam=event
||youtube.com/redirect?$removeparam=redir_token
||youtube.com/redirect?$removeparam=v Then it will give you a warning when you visit the link. Anyway, I don't think it's something that can be addressed easily (other than messing with that |
Oh ok, I didn't realize this. Not sure if the issue with the event handler can be fixed, this will need some research. |
@gorhill The full link is contained in the Example: It looks like the scriptlet should be more flexible to be able to specify where exactly the link should come from. Then the rules will be something like this: |
Related issue: - uBlockOrigin/uBlock-issues#2531 (comment) Usage: - example.com##+js(href-sanitizer, a[href^="/go?to="]:not([title])) - example.com##+js(href-sanitizer, a[href^="/go?to="][title], [title]) The second argument is the attribute from which to extract the text to be used for the `href` attribute of the link. If the second attribute is absent, the text content of the element will be used.
Change in next dev build, however I renamed |
@gorhill |
@gorhill Example: Requires the ability to point to it: |
Yes that's the issue (if you use |
There's no query param to extract url from. Need to modify the scriptlet to handle such cases. |
Is it possible to add an argument to reverse the current behavior for |
About twitter twitter.com,~platform.twitter.com##+js(trusted-replace-xhr-response, '/,"expanded_url":"([^"]+)","url":"[^"]+"/g', ',"expanded_url":"$1","url":"$1"', /api/graphql) |
It's working. |
Ok, I'll test it with dev build first |
also move to testing on Firefox
The rule stopped working. |
@Yuki2718 Currently I'm testing on just Firefox. Can you check again? |
I was wrong, the rule is still working for usual links. It doesn't work only for card links with images like the one in |
Yeah, the card is quite hard, I don't know how to address it |
Hmm... From this link: https://help.twitter.com/en/using-x/url-shortener , looks like What do you guys think? Or maybe we can move it to annoyance list? |
Yeah, maybe safer to move to annoyance. |
Ordinary links cannot be checked for malware? |
Hmm... By which method? |
I think this is just Twitter's excuse to track clicks. |
Yeah, I haven't ever warned when clicking bad links for badware. But who knows. |
Found an example Twitter/X warns if via |
Links in |
I think it's fine to address |
A report regarding to Brave's debounce feature that's related to facebook's redirect URL Should we still address twitter's and facebook's redirect URLs in annoyance list? |
If the URL of a clickable link is malware, why is Facebook allowing these links to be embedded on their site in the first place? |
Prerequisites
I tried to reproduce the issue when...
Description
The site vk.com is one of the most visited Russian sites. All external links on this site are done through a redirect.
There is an idea to create a scriptlet with a name like "anti-redirect" based on this script: https://greasyfork.org/en/scripts/395977-vk-com-del-redir/code
A specific URL where the issue occurs.
https://vk.com/amedia.online
Steps to Reproduce
undefined
Expected behavior
undefined
Actual behavior
undefined
Configuration
uBlock Origin development build 1.47.5b2
The text was updated successfully, but these errors were encountered: