
Tell HN: Google uses a Chrome-specific feature to highlight text on any website - hk__2
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.<p>I looked in the URL bar and saw this: https:&#x2F;&#x2F;www.quora.com&#x2F;Why-do-I-see-numbers-and-not-contacts-names-In-WhatsApp#:~:text=If%20your%20contacts&#x27;%20numbers%20are,Go%20to%20Account%20%3E%20WhatsApp.<p>Note the #:~:text= part. If you use it with Chrome on any other website you can highlight any text:<p><pre><code>     https:&#x2F;&#x2F;www.ycombinator.com&#x2F;#:~:text=Y%20Combinator
     http:&#x2F;&#x2F;paulgraham.com&#x2F;useful.html#:~:text=useful
</code></pre>
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.
======
awirth
This 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.

------
hk__2
This appears to be part of a test: [https://9to5google.com/2019/08/26/google-
search-highlight-we...](https://9to5google.com/2019/08/26/google-search-
highlight-website-content/)

