redirect-link icon indicating copy to clipboard operation
redirect-link copied to clipboard

Support formats alone on fields

Open khabib227 opened this issue 2 years ago • 8 comments

For instance I have this url:

https://example.com/?redirectUrl=https://google.com

If I put in URL field just %q or %q[redirectUrl]

The redirect result should be https://google.com, currently Redirect Link don't support it, or I'm doing something wrong?

The objective here is make a rule to skip the redirect, going direct to the original url.

khabib227 avatar Aug 11 '23 17:08 khabib227

%q[redirectUrl] does work for me. %q doesn't work because it tries to load redirectUrl=https://google.com, which is invalid address. I think for %q only it makes sense to have all the query parameters.

fluks avatar Aug 15 '23 13:08 fluks

Estrange not work here, I set it so:

Enable URL:

https://deref-gmx.com/mail/client/

also tried

https://deref-gmx.com/mail/client/*

in URL I put just

%q[redirectUrl]

Don't work here, the query parameter is

/?redirectUrl=https%3A%2F%2Fgithub.com%2Ffluks%2Fredirect-link%2Fissues%2F35%23issuecomment-1678953396

khabib227 avatar Aug 15 '23 16:08 khabib227

So the whole URL you are trying to redirect is https://deref-gmx.com/mail/client/?redirectUrl=https%3A%2F%2Fgithub.com%2Ffluks%2Fredirect-link%2Fissues%2F35%23issuecomment-1678953396 ? I can't load that link because the site redirects that automatically back to https://www.gmx.com/. Can you post some other example which doesn't work?

fluks avatar Aug 16 '23 03:08 fluks

Another instance:

https://www.google.com/imgres?imgurl=https%3A%2F%2Ftressays.files.wordpress.com%2F2015%2F09%2Ftest-clip-art-cpa-school-test.png

I tried put just %q and tried also just %q[imgurl] on URL field, don't worked, I'm doing something wrong?

khabib227 avatar Aug 16 '23 16:08 khabib227

%q shouldn't work and it doesn't. But %q[imgurl] does work. I don't know why it doesn't work for you. Did you leave Enable URL blank? Try it if you didn't. Or can you see the option to redirect that URL and it just fails?

If you can go about:debugging and then This Firefox and press inspect and then try to redirect and go to console tab and see if there's an error.

fluks avatar Aug 16 '23 17:08 fluks

Any error on console, I do not tried blank url because I need the Always option and to work only in a specific url, but I tried redirect manually and don't go, the result of manual redirection is:

moz-extension://*********/background/https%3A//tressays.files.wordpress.com/2015/09/test-clip-art-cpa-school-test.png

******* = extension id

I'm using firefox 112.0.1 is it maybe? My rule:

Capture

khabib227 avatar Aug 18 '23 01:08 khabib227

Okay, now I know the reason. If you first open the previous example URL and then redirect, it works, but if you try to redirect the link, it doesn't. And the reason is that at least %3A isn't decoded to :, so Firefox doesn't understand it as a valid URL. So, the query parameter needs to be URL decoded. I need to think this a little that can the resulting redirect URL always be fully URL decoded in the end.

fluks avatar Aug 18 '23 03:08 fluks

I also suspected about the enconded URL, I hate this encoded URLs :D

khabib227 avatar Aug 18 '23 18:08 khabib227