cu / silicon

Silicon Notes, a web-based personal knowledge base with few frills
Other
220 stars 7 forks source link

consider implementing Scroll to Text Fragment #11

Closed cu closed 6 months ago

cu commented 1 year ago

Could be useful when coming to a page through the search results:

At this time, I'm not totally clear on how it works under the hood or if it's even useful for cases where a page contains dozens of results for a single search term. Possible it may only be used when the search query contains double quotes.

cu commented 6 months ago

Upon further investigation, I don't think this is helpful for us for the following reasons:

  1. There does not seem to be a way to restrict the fragment to a particular section of the page, e.g. within an <article> element. In Silicon, we have parts of the page (the sidebar, mainly) that should never be highlighted with a fragment and there does not seem to be any mechanism for avoiding that. And all of the workarounds for this that I can imagine are Very Complicated.
  2. Unless I'm just plain missing it, it doesn't look like text fragments will highlight multiple matches.
  3. Usage of it apparently requires the rel=noopener attribute on all links. For reasons that are not particularly clear.
  4. Everything about the design of Text Fragments seems to be specifically for Google's use case of sending the user directly to the snippet of text that they searched for when coming to a page via search engine results and no other use case. In other words, generalization of the feature for other use cases (especially text highlighting within the same page/app) seems to be an intentional and deliberate omission.