3

Recently I've noticed that results in Google and Bing in Chromium-based browsers (Chrome, newer versions of Edge, Chrome on Android) will take you to the page with relevant information highlighted. It does not work in Firefox.

For example:

https://en.wikipedia.org/wiki/Stack_Overflow#:~:text=Stack%20Overflow%20is%20written%20in%20C%23

Wikipedia example

I've figured out the general scheme of how these anchors work, but I'm not able to find any documentation about this functionality because the search term "#:~:" is near impossible to search for. Is this a Chromium exclusive feature or are there any standards for it so that this feature may be implemented in other places?

1 Answer 1

4

It was difficult to search for, but I found the feature release for Chrome as well as a draft specification around ScrollToTextFragment which is the name of this functionality.

Also of note, some concerns about this functionality from Mozilla, such as user's search terms getting logged since they are included in the URL, nefarious purposes since this causes the browser to scroll, and implementations that treat hash characters in the URL in nonstandard ways where this causes issues on the page.

This feature is offered by Google and spun out of a capability offered in AMP pages since 2018.

2
  • 1
    Regarding support, based on some manual testing, the latest version of Opera appears to also support this feature by default. That said, as you indicate, Mozilla has apparently had some concerns about this feature in the past and using :~:text= didn't work when testing the Portable Apps version of Firefox 77.0.1. This doesn't mean there may not be a flag for it, but if there is, it doesn't seem to be enabled. Commented Jun 10, 2020 at 20:34
  • 1
    Agreed, this is hard to search for but somehow I found your answer. Thanks!
    – tom
    Commented Jun 16, 2020 at 13:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .