GoogleChromeLabs/link-to-text-fragment

Provide progress indicator.

Closed this issue · 6 comments

Large sites like https://service.unece.org/trade/locode/gb.htm can take a while to extract a text fragment from.

  1. Consequently, provide a progress indicator to communicate to the user how much has been iterated over.
  2. Being able to click the extension to see the last extracted text fragment would also be useful when leaving a page such as the aforementioned to run as a background task, since some clipboards might delete the copied link before the user realizes that it is complete.

image

For some reason the native feature "thinks" the text is unlinkable:

Screenshot 2023-07-18 at 19 00 34

However, a manually created link works just fine: https://service.unece.org/trade/locode/gb.htm#:~:text=NRW.

The extension blocks the page and the tab becomes unresponsive.

I have filed https://crbug.com/1465883. The native Chrome implementation and the extension use essentially the same algorithm for creating links. Looks like there's an issue.

Missing context: the extension uses the algorithm implemented in https://github.com/GoogleChromeLabs/text-fragments-polyfill.

#88 (comment)

@tomayac, why close the issue? I still think that a progress indicator would be really useful, as would asynchronous operations (although perhaps better in a separate issue?)

If you ever need to wait for a link to be created, something is wrong with the algorithm, which is outside of this repo (see the link to the algorithm repo above). Also, there's no way to know how long you'd have to wait, so at best, we could show a meaningless spinner.

#88 (comment)

Yeah, @tomayac, even a spinner would have made diagnosing the issue easier.

This was really an exceptional case, where for some reason the entire page got blocked. The Chrome bug is the place to star if you want to follow up. Thank you.