-
Notifications
You must be signed in to change notification settings - Fork 82
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
Add queryjump to redirect url (urlskip) #3206
Comments
This comment was marked as abuse.
This comment was marked as abuse.
Related issue: uBlockOrigin/uBlock-issues#3206 The main purpose is to bypass URLs designed to track whether a user visited a specific URL, typically used in click-tracking links. The `urlskip=` option ... - ... is valid only when used in a trusted filter list - ... is enforced only on top documents - ... is enforced on both blocked and non-blocked documents - ... is a modifier, i.e. it cannot be used along with other modifier options in a single filter The syntax is `urlskip=[steps]`, where steps is a space-separated list of extraction directives detailing what action to perform on the current URL. The only supported directive in this first commit is `?name`, which purpose is to extract the value of a named URL parameter and use the result as the new URL. Example: ||example.com/path/to/tracker$urlskip=?url The above filter will cause navigation to https://example.com/path/to/tracker?url=https://example.org/ to automatically bypass navigation to `example.com` and navigate directly to https://example.org/ It is possible to recursively extract URL parameters by using more than one directive, example: ||example.com/path/to/tracker$urlskip=?url ?to More extraction capabilities may be added in the future.
Test cases: Filters:
Navigate to Navigated to: Filter:
Navigate to Navigated to: Filter:
Navigate to Navigated to Note: No skip occurred since not all extraction directives could be fulfilled |
Spaces before "?" are needed? |
Yes. Commit message:
In the future we might want to add base64-decoding or regex extraction ( |
Hi, when I want to reach
I wrote a filter rule as |
I think the parameter value should be a valid string to use with new URL("hepsiburada.com/philips-ca6700-10-espresso-machine-kirec-temizleme-solusyonu-p-HBCV00002YNJSF") will return error, so no, you can't use |
So what kind of filter rule should I write for this? |
That is not a valid
However as @stephenhawk8054 pointed out, the extracted string is not a valid URL as per URL API, so it does not work in the end. I do think it should work though, so I will see what can be done about it. |
When present, the `+https` directive will force the protocol of the resulting URL to be `https:`. Related feedback: uBlockOrigin/uBlock-issues#3206 (comment)
In the next dev build, this should work:
|
This comment was marked as abuse.
This comment was marked as abuse.
Sorry to bump this but I really didn't think this was worth making a whole new issue for, I know this was added in the past couple weeks so I haven't been able to find any documentation or anyone asking about this case scenario: How do I use $urlskip if the hyperlink URL doesn't even have a property after the For convenience I was using this to successfully skip Pixiv's kinda redundant outbound link capture page However, on gallery pages the links in the description actually do not have Obviously I can't make a rule like |
The initial version of People can then report cases which cannot be handled by the current So what you are reporting here is a case where the URL to skip to is encoded as a parameter name. I will think if and what could be done about this. By the way, in general to make me more motivated to work on this, having actual cases I can reproduce immediately on my side helps a lot. If I cannot immediately reproduce, I typically lose interest and move on to do other stuff. Best way is to provide a URL I just have to navigate to and reproduce the issue without further complication like having to create an account etc. |
Wow that was a fast response, thanks. Sorry about the example link, I didn't realise it wouldn't work, I see that if the link is put straight into the address bar it just takes you to an error page. The a tags in the HTML use I was starting a bit of a ramble about the properties in URL objects but after seeing your post edit I figured you probably would already know about this anyway: the start of the rambleSo I was still tinkering with this and tried doing `new URL` in the dev tools console like stephenhawk8054 showed, and the URL object has the destination URL as a `search` property containing the encoded chars and the question mark at the beginning. It also has a `searchParams` property containing a `URLSearchParams` object with one entry ... |
Where do I click on that page to trigger the navigation to the cloaked URL? |
That's percent encoding. Support for it will have to be added and doesn't exist yet. |
Relate case: uBlockOrigin/uBlock-issues#3206 (comment) Newly supported step: `&i`, meant to lookup a parameter's name at position `i` (1-based). The parameter name will be used as the URL (whereas `?` is meant to lookup a parameter's value).
This should work with 1.60.1b6 and above:
|
It works, I just missed the |
Is it possible to use use urlskip when the link is part of the path? |
Yes, I expected such case would be reported eventually. On which website did you encounter such link? |
Related feedback: uBlockOrigin/uBlock-issues#3206 (comment) The first capture group of the regex will be used as the result of the transformation. Example: ||podtrac.com/pts/redirect.mp3/$urlskip=/podtrac\.com\/pts\/redirect\.mp3\/(.*?\.mp3\b)/ +https If the regex is invalid, or if it fails to extract a first capture group, no redirection will occur.
This should work in the dev build 1.60.1b11 and above:
I will add the filter to uBO's privacy list. |
Sorry, didn't realize this.
Now I am questioning that we really need Should a case like so arise:
Then this can already be taken care of without
An argument to keep |
This comment was marked as abuse.
This comment was marked as abuse.
@gorhill In this link http://go.redirectingat.com/?id=355X561&test=off&xcust=94d11aa0976a11efb985b213d4e1265c0INT&url=https%3A%2F%2Fwww.menards.com%2Fmain%2Fstorage-organization%2Fgarage-outdoor-storage%2Fbike-storage%2Ftailgate-bike-rack-carrier-protection-pad-5-bike%2Frmbp500%2Fp-1642874308595068-c-12651.htm Should we wrap the full link of redirected link in case it's too long? |
This comment was marked as abuse.
This comment was marked as abuse.
On mobile, not preventing multiline pushes the Back/Proceed buttons below the viewport and I think this would be an issue for a lot of people who would think they have to click the link as the only choice. The link is not in |
I can let the link wrap but I will limit the height on mobile. |
This comment was marked as abuse.
This comment was marked as abuse.
The page is telling me it's going to navigate there, as a user I would be wondering why not just make the link clickable then.
Right-click, "Copy link" / "Copy link address" |
This comment was marked as abuse.
This comment was marked as abuse.
@gorhill I see the domains are marked bold in the strict-blocked page, is it intended? |
This comment was marked as abuse.
This comment was marked as abuse.
I saw that https://github.com/gorhill/ublock/wiki/static-filter-syntax has this example: ||example.com/path/to/tracker$urlskip=-blocked ?url Is there any specific reason for This got me thinking: If you specify multiple Consider
I haven't tried this and haven't run into any real-life examples, but I wonder if the order of the directives should be formalized a bit. |
@gorhill Sorry, is it possible to automatically use |
You mean if the protocol is present and is |
Yeah exactly. |
@gorhill In this link: https://theatre2.prospect2.com/Prod/link-tracker?redirectUrl=aHR0cCUzQSUyRiUyRnRoZWF0cmUyLm9yZyUyRnN1YnNjcmliZSUzRnV0bV9zb3VyY2UlM0RBY3RpdmVDYW1wYWlnbiUyNnV0bV9tZWRpdW0lM0RlbWFpbCUyNnV0bV9jb250ZW50JTNEVGhlYXRyZVNxdWFyZWQlMkJwcm9kdWN0aW9uJTJCb2YlMkJUaWdlciUyQlN0eWxlJTI1MjElMkJiZWdpbnMlMkJGZWJydWFyeSUyQjIzJTI2dXRtX2NhbXBhaWduJTNEUFIlMjUzQSUyQlRpZ2VyJTJCU3R5bGU=&sig=8MyAZqfWi4D4y6jQ74HofpnnUiWyDBP7zh1Mhb1PDywm&iat=1644533531&a=%7C%7C1001253958%7C%7C&account=theatre2%2Eactivehosted%2Ecom&email=x5iTFbWD27OamnRX5Z9MOqSyIXu03Akc1Z8hSpIr818%3D&s=3949e035518f7fd77b4f62360256cda3&i=368A382A2A4505 The URL inside http%3A%2F%2Ftheatre2.org%2Fsubscribe%3Futm_source%3DActiveCampaign%26utm_medium%3Demail%26utm_content%3DTheatreSquared%2Bproduction%2Bof%2BTiger%2BStyle%2521%2Bbegins%2BFebruary%2B23%26utm_campaign%3DPR%253A%2BTiger%2BStyle which needs another layer of uri-decode. Could there be any ways to address this? Reference: brave/adblock-lists#993 |
|
I don't think so. I tested
but it doesn't work. |
Oh wait, sorry my bad. The destination link is
|
Automatically upgrade `http:` to `https:` in the resulting URL. Related feedback: uBlockOrigin/uBlock-issues#3206 (comment)
@gorhill Sorry, currently in the result links of Bing search, the URLs look like this: https://www.bing.com/ck/a?!&&p=ef7ef125927f4fd6e7fd462510d6c90eccceb80d05a10a1250756826aa14611dJmltdHM9MTczMTk3NDQwMA&ptn=3&ver=2&hsh=4&fclid=26de3a35-cd30-618a-182b-2f08cce2603e&psq=lenovo+thinkpad+z16&u=a1aHR0cHM6Ly93d3cubGVub3ZvLmNvbS9qcC9qYS9wL2xhcHRvcHMvdGhpbmtwYWQvdGhpbmtwYWQtei1zZXJpZXMvdGhpbmtwYWQtejE2LSgxNi1pbmNoLWFtZCkvbGVuMTAxdDAwMzc_bXNvY2tpZD0yNmRlM2EzNWNkMzA2MThhMTgyYjJmMDhjY2UyNjAzZQ&ntb=1 I tried ||bing.com/ck/a*^u=a1aHR0c$doc,urlskip=/[?&]u=a1(aHR0c[^&#]+)/ -base64 +https but not succeeded. Can you reproduce? |
@stephenhawk8054 there is an error or some special encoding in base64 string, around the |
Ah you're right, I forgot to check the Ah ok, it replaces these special values with other values value.replace(/\s+/g, '').replace(/\-/g, '+').replace(/\_/g, '/') |
https://docs.python.org/3/library/base64.html#base64.urlsafe_b64encode |
Information: a related subthread: #3499 with a discussion related to added support for a step to extract hash ( |
Prerequisites
I tried to reproduce the issue when...
Description
Mentioned in #760 (comment) #2476 (comment) and now it should be possible to implement as a trusted network filter modifier. It's similar to
$uritransform
except that this should redirect to different domain and complementshref-sanitizer
. Maybe$to
or something can be combined to restrict the domain to redirect rather than always blindly trust the url in parameter. Though the original context was about shortners, I rather want to use this to automate skip of strict-block page which is currently possible only by manual click.A specific URL where the issue occurs.
`https://ouo.io/s/BulJXu78?s=http://hackstore.link/alg2i`
Steps to Reproduce
NA
Expected behavior
NA
Actual behavior
NA
uBO version
1.57.0
Browser name and version
Not relevant
Operating System and version
Windows 10
The text was updated successfully, but these errors were encountered: