3 ms·
Tell HN: Google uses a Chrome-specific feature to highlight text on any website
I searched for something and clicked on a Quora search result that highlighted the search result text. I was surprised because Quora can’t know what the search result looked like and so doesn’t know which part of the text to highlight.
I looked in the URL bar and saw this: https://www.quora.com/Why-do-I-see-numbers-and-not-contacts-names-In-WhatsApp#:~:text=If%20your%20contacts'%20numbers%20are,Go%20to%20Account%20%3E%20WhatsApp.
Note the #:~:text= part. If you use it with Chrome on any other website you can highlight any text:
https://www.ycombinator.com/#:~:text=Y%20Combinator
http://paulgraham.com/useful.html#:~:text=useful
I can’t find any documentation on this feature. Google appears to append it to the anchor when you click on a search result in Chrome.
- hk__2 6y agoThis appears to be part of a test: https://9to5google.com/2019/08/26/google-search-highlight-website-content/ https://9to5google.com/2019/08/26/google-search-highlight-we...
- awirth 6y agoThis is called ScrollToTextFragment. See https://github.com/WICG/ScrollToTextFragment https://github.com/WICG/ScrollToTextFragment I think they just started doing this a few hours ago. I only noticed it in the "Featured Snippet" box. Edit: > I was surprised because Quora can’t know what the search result looked like and so doesn’t know which part of the text to highlight. Did Google at some point stop sending referer headers that include the query? The last time I checked (~10 years ago, admittedly), they did, which was often collected for analytics. Regardless, it's the browser doing the highlighting in this case, not the site itself.