CoreLibs icon indicating copy to clipboard operation
CoreLibs copied to clipboard

Add $urltransform (trusted) modifier support

Open zzebrum opened this issue 4 years ago • 6 comments

It might be useful to have a $rewrite modifier that supports all kinds of redirections, basically a $replace modifier for URLs.

There are many use cases where this modifier may be useful, but overall it's too dangerous to allow it to be used in third-party lists so it should be limited to trusted filters only.

UPD 17.01.2024: uBO renamed to uritransform since syntax was changed in 1.54. https://github.com/AdguardTeam/CoreLibs/issues/1364#issuecomment-1864282857

Original report:

@BlitW0 commented on [Wed Oct 14 2020](https://github.com/AdguardTeam/AdguardForAndroid/issues/3634)

Problem Description

Add a way to redirect a URL to a different URL based on regex rules.

Proposed Solution

No idea how it would work, but it might be separate section in settings since standard filter rules do not support URL redirection.

Alternatives Considered

Tried to see if standard filters with ABP syntax can do this, but was not able to find anything.


@TheHasagi commented on Thu Oct 15 2020

@BlitW0

Hello! Can you explain with more details for what purposes do you need such a feature?


@zzebrum commented on Mon Oct 19 2020

@BlitW0 any update?


@BlitW0 commented on Mon Oct 19 2020

My reason was for redirecting reddit's awful mobile website to the compact version or old reddit. It might also be useful for different sites in the same manner? I know it is possible through userscripts but it may not always be possible to write scripts on mobile, so this can be an easier way through GUI.

zzebrum avatar Oct 20 '20 12:10 zzebrum

Merged urltransform here: https://github.com/AdguardTeam/CoreLibs/issues/1820

Let's call it urltransform since there's already existing modifier.

@slavaleleka could you please also create an issue in tsurlfilter?

ameshkov avatar Nov 07 '23 11:11 ameshkov

One question, I see that it's limited to relative redirects to the same origin in uBO. Do we want to allow redirects to any URLs since it's a trusted modifier anyways?

Alternatively, we could allow redirects to one specific origin (filters.adtidy.org for instance) that's trusted.

What do you think?

ameshkov avatar Nov 07 '23 11:11 ameshkov

uBO renamed to uritransform since syntax was changed in 1.54.

Yuki2718 avatar Dec 20 '23 11:12 Yuki2718

Hello I don’t want to put pressure of any kind. I know you do a fantastic job and I'm a huge fan of the Adguard Products. But as I'm the requestor of the duplicate #1557 since some years already (2021), I just wanted to know the status of the feature. I know it's for v1.15 but it looks so far. And currently, the only alternative for this kind of advertising/tracking is ClearURLs but it won't work on Safari and the developer is not keeping it up to date anymore.🙁 As this request has been duplicated at least 3 times, I know it is expected by quite a few people. (well, I think).

Kind regards,

imTHAI avatar Jan 20 '24 20:01 imTHAI

We really want to improve the speed with which CoreLibs updates are rolled out so 1.15 shouldn't be that far.

The main issue with this modifier is that it's kinda too powerful, we may need to make it more clear to the user what it means to make a filter list "trusted".

ameshkov avatar Jan 22 '24 11:01 ameshkov

For filter lists I think limiting it to Full trust level will be enough. I rather worry that this can be used in User rules, after seeing people add whatever rules they found online without second thought. AG apps has low-level settings which average user won't touch and I guess Full trust rules should be disabled by default and should only be enabled in the settings by advanced user.

Yuki2718 avatar Jan 22 '24 11:01 Yuki2718