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

Do not remove pre-existent #.*: section of URI. #92

Closed
RokeJulianLockhart opened this issue Aug 17, 2023 · 3 comments
Closed

Do not remove pre-existent #.*: section of URI. #92

RokeJulianLockhart opened this issue Aug 17, 2023 · 3 comments

Comments

@RokeJulianLockhart
Copy link

RokeJulianLockhart commented Aug 17, 2023

If I use the extension on https://www.myheritage.com/FP/memberEditProfile.php?s=781598791&memberID=1085838471&sourceList=#notificationPanelAnchor:~:text=I%20am%20researching%3A-,my%20email%20,-Email%3A at https://www.myheritage.com/FP/memberEditProfile.php?s=781598791&memberID=1085838471&sourceList=#notificationPanelAnchor, notificationPanelAnchor is removed, resulting in https://www.myheritage.com/FP/memberEditProfile.php?s=781598791&memberID=1085838471&sourceList=#:~:text=I%20am%20researching%3A-,my%20email%20,-Email%3A.

This is erroneous, because that part of the URI has meaning, especially in circumstances where it isn't simply used to communicate where scroll the page to. However, in the instances that it is, such as at https://en.wikipedia.org/wiki/Allied_invasion_of_Italy#Salerno_landings, it is a useful fallback for browsers where fragment support is unavailable.

@RokeJulianLockhart RokeJulianLockhart changed the title Do not remove pre-existent #[A-Za-z0-9]+: section of URI. Do not remove pre-existent #.*: section of URI. Aug 18, 2023
@tomayac
Copy link
Member

tomayac commented Aug 18, 2023

This has been discussed in WICG/scroll-to-text-fragment#75. The spec also has a section about this question. There are two cases: the first case is the one where the page actually has an element with the hash ID, like <h1 id="example">Example</h1>, and the second case it the one where the hash is used as a JavaScript-based router, but doesn't appear in the page, like https://example.com/#page1. Your example seems to be the latter, in which case "If the UA cannot reliably determine an appropriate fragment to fallback to, it should remove the fragment id from the URL" kicks in.

@tomayac tomayac closed this as completed Aug 18, 2023
@RokeJulianLockhart
Copy link
Author

RokeJulianLockhart commented Aug 18, 2023

#92 (comment)

@tomayac, WICG/scroll-to-text-fragment#75 (comment) discusses the behaviour of the search functionality when the fragment is included with the directive. I don't care about that; I just want this extension to not remove that portion because it causes issues when the fragment isn't used for searching the page. Fragments are frequently used for other purposes, so they're as important a part of any URI as any other.

WICG/scroll-to-text-fragment#75 (comment) states

The fragment still serves as a fallback with the current design (we scroll to the fragment ID if we can't find the text directive)

so I'm extra confused by why keeping the fragment included isn't desirable.

tomayac added a commit that referenced this issue Aug 21, 2023
@tomayac
Copy link
Member

tomayac commented Aug 21, 2023

Just submitted v2.4.0 to the store that preserves potentially existing hashes.

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

2 participants