Skip to content

Hash tag wrongly encoded #189

Description

@jer-sen

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 #86 and #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.

Activity

  1. self-assigned this
    on Mar 29, 2022
  2. KevinRoebert commented on Mar 29, 2022

    @KevinRoebert
    Member

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

  3. LorenzHenk commented on Apr 4, 2022

    @LorenzHenk

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

  4. samueljun commented on Apr 14, 2022

    @samueljun

    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 webcompat/web-bugs#102413 thinking it was a Firefox vs Chrome issue.

  5. sourpatched commented on Apr 21, 2022

    @sourpatched

    This effects Jelllyfin Web GUI as well.

  6. nbusseneau commented on Jul 12, 2022

    @nbusseneau

    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)

  7. SunsetTechuila commented on Jan 27, 2025

    @SunsetTechuila
    Contributor

    can't reproduce with 1.27.1, probably was fixed in 0d7381f

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions