Addon icon indicating copy to clipboard operation
Addon copied to clipboard

Hash tag wrongly encoded

Open jer-sen opened this issue 3 years ago • 6 comments
trafficstars

This kind of URL http://abc.com/#k/some/hash is wrongly replaced by http://abc.com/#k%2Fsome%2Fhash=. This leads to many issues with some websites. This can be easily tested and reproduced with embedded cleaningTool.html (at least on Firefox).

This issue may be linked to these https://github.com/ClearURLs/Addon/issues/86 and https://github.com/ClearURLs/Addon/issues/100

The bug is here: https://github.com/ClearURLs/Addon/blob/b67a6569185d18a7df94805538e0480abef43517/core_js/tools.js#L127=

The hash part (what is called fragments) should not be converted as a URLSearchParams object and then used after a toString() call.

jer-sen avatar Mar 29 '22 12:03 jer-sen

Ok, seems to be a bug indeed. I guess I have to write something like URLSearchParams myself for the hash part of a URL.

KevinRoebert avatar Mar 29 '22 13:03 KevinRoebert

Please also note the appended = at the end. Something similar happens with this URL: https://www.typescriptlang.org/tsconfig#target See https://github.com/microsoft/TypeScript-Website/issues/2318

LorenzHenk avatar Apr 04 '22 09:04 LorenzHenk

I ran into this issue when trying to load the following link https://www.typescriptlang.org/play?q=315#example/enums

The url gets transformed to "https://www.typescriptlang.org/play?q=315#example%2Fenums=", and I see the error "There was an issue getting the example, bad URL? Check the console in the developer tools" on the TypeScript website.

I had initially reported the issue https://github.com/webcompat/web-bugs/issues/102413 thinking it was a Firefox vs Chrome issue.

samueljun avatar Apr 14 '22 19:04 samueljun

This effects Jelllyfin Web GUI as well.

sourpatched avatar Apr 21 '22 09:04 sourpatched

Can confirm this is still happening, the AWS console is another example of a website that completely breaks because it relies on hash-based navigation (e.g. when you move between tabs of the same page).

Example: https://us-east-1.console.aws.amazon.com/iam/home#/users/foo?section=groups

(Thanks for your work in any case :D)

nbusseneau avatar Jul 12 '22 16:07 nbusseneau