Skip to content
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

Infinite redirect loops #138

Open
crpmax opened this issue Dec 29, 2023 · 7 comments
Open

Infinite redirect loops #138

crpmax opened this issue Dec 29, 2023 · 7 comments

Comments

@crpmax
Copy link

crpmax commented Dec 29, 2023

Hello,

I think the essence of the problem is the same as ClearURLs/Addon#318 and ClearURLs/Addon#295

I use Firefox (Developer edition) and ClearURLs 1.26.1.

I noticed that in some circumstances, on some sites, an infinte redirect loop will happen.
When I turn off the extension, the page loads fine.

Examples

Aliexpress

The first example is this Aliexpress link (you must have cookies cleared or open it in an anonymous window).
https://www.aliexpress.us/item/3256804772697909.html?gatewayAdapt=glo2usa4itemAdapt

With the extension enabled, it loops like this:

https://www.aliexpress.us/item/3256804772697909.html?gatewayAdapt=glo2usa4itemAdapt
https://login.aliexpress.com/sync_cookie_read.htm?xman_goto=https://www.aliexpress.us/item/3256804772697909.html?gatewayAdapt=glo2usa4itemAdapt
https://login.aliexpress.us/sync_cookie_write.htm?acs_random_token=fc727d114bac447797ccc6eb4fe10365&xman_goto=https://www.aliexpress.us/item/3256804772697909.html?gatewayAdapt=glo2usa4itemAdapt
https://www.aliexpress.us/item/3256804772697909.html?gatewayAdapt=glo2usa4itemAdapt

This will end with a browser NS_ERROR_REDIRECT_LOOP error.

With the extension disabled, it loads the page fine, like this:

https://www.aliexpress.us/item/3256804772697909.html?gatewayAdapt=glo2usa4itemAdapt
https://login.aliexpress.com/sync_cookie_read.htm?xman_goto=https://www.aliexpress.us/item/3256804772697909.html?gatewayAdapt=glo2usa4itemAdapt
https://login.aliexpress.us/sync_cookie_write.htm?acs_random_token=fc727d114bac447797ccc6eb4fe10365&xman_goto=https://www.aliexpress.us/item/3256804772697909.html?gatewayAdapt=glo2usa4itemAdapt&_ga=GA1.1.24aa559a-9c91-4671-96b2-516913520946.1703841605313
https://www.aliexpress.us/item/3256804772697909.html?gatewayAdapt=glo2usa4itemAdapt
https://www.aliexpress.us/item/1005004959012661.html?gatewayAdapt=4itemAdapt

The difference I see is the _ga parameter. Without it, it seems like Aliexpress is not redirecting properly.

Google Trends

The next example is Google Trends.
When I search for a term and I try to select the country or time span, the URL in the URL bar will start changing back and forth rapidly.
It loops between these two URLs:

https://trends.google.com/trends/explore?date=now%201-d&q=php
https://trends.google.com/trends/explore?date=now+1-d&q=php

The difference is that it is not a full redirect, but it only changes the URL in the URL bar. It also looks like it changes between a space or a plus symbol instead of a space.
So it does not end with NS_ERROR_REDIRECT_LOOP, but it will loop infinitely.
When I disable the extension, the loop stops.

Solution?

I think the solution is not to manually whitelist sites with the problem, but to make the extension detect the redirect loop and whitelist the whole site automatically.
It looks like Firefox shows an NS_ERROR_REDIRECT_LOOP error after 16 redirects.
So maybye try to count the redirects and on 13 redirects, for example, add the site to the whitelist?
Or try to detect the NS_ERROR_REDIRECT_LOOP error, add the site to the whitelist, and refresh the page automatically?
With the Google Trends problem, count changes to the url instead of redirects?

Thank you.

@iznawh
Copy link

iznawh commented Jan 25, 2024

yea i am also having this problem with aliexpress as well, a whitelist would be great

@KZNcode
Copy link

KZNcode commented Mar 7, 2024

same problem.

@evgfilim1
Copy link

evgfilim1 commented Aug 19, 2024

Google Trends

The next example is Google Trends. When I search for a term and I try to select the country or time span, the URL in the URL bar will start changing back and forth rapidly. It loops between these two URLs:

https://trends.google.com/trends/explore?date=now%201-d&q=php
https://trends.google.com/trends/explore?date=now+1-d&q=php

The difference is that it is not a full redirect, but it only changes the URL in the URL bar. It also looks like it changes between a space or a plus symbol instead of a space. So it does not end with NS_ERROR_REDIRECT_LOOP, but it will loop infinitely. When I disable the extension, the loop stops.

I have a similar problem but with local JetBrains YouTrack instance. The extension decodes %-encoded parts, but the browser (Firefox) seems to encode them back.

@colejohnson66
Copy link

Same issue with YouTrack. Managed to track it down to this extension.

@ccuser44
Copy link

Related to ClearURLs/Addon#308

@ccuser44
Copy link

This has only been happening for me with escaped characters for a long time but now many sites like DuckDuckGo seem to have infinite redirect loops too due to the plugin completely stripping away all url params. I've also had firefox crash a few times due to this for bad memory allocation

@KevinRoebert
Copy link
Member

This has only been happening for me with escaped characters for a long time but now many sites like DuckDuckGo seem to have infinite redirect loops too due to the plugin completely stripping away all url params. I've also had firefox crash a few times due to this for bad memory allocation

We’re aware of the issue, and an update has already been submitted to Mozilla for review. It should be approved within the next few days, resolving the problem.

Should be fixed by ClearURLs/Addon#415.

You're currently using the version 1.27.1?

@KevinRoebert KevinRoebert transferred this issue from ClearURLs/Addon Jan 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants