You're probably familiar with anchors — the hashtags on the end of links that take you to a specific part of the link (like https://en.wikipedia.org/wiki/Android_(operating_system)#History). Anchors are handy, but the page has to provide those anchors. Google is currently experimenting with a new anchor method, where users can create links that will take someone to any given phrase or sentence on a page.

A commit to the Chromium Gerrit, spotted by Chrome Story, reveals that a new "enable-text-fragment-anchor" flag is being added. The flag hasn't appeared in the Canary branch yet, so we can't test it out, but a document by Chrome engineer David Bokan explains how the feature might work.

"To enable users to easily navigate to specific content in a web page, we propose adding support for specifying a text snippet in the URL fragment," Bokan wrote. "When navigating to a URL with such a fragment, the browser will find the first instance of the text snippet in the page and bring it into view."

The current proposed method is for the browser to attach the start and end of the phrase to the page URL. For example, if the user selected "The lazy dog jumped over the quick brown fox," the shared link would look like this:

www.example.com#targetText=the%20lazy%20dog,brown%20fox

The feature is still very early in development, so at the earliest, we're several months away from seeing this in the Stable branch of Chrome. It's also possible that Google might decide not to implement this — Bokan's own proposal admits it could break some sites that use the anchor to store data.

UPDATE: 2019/02/18 10:44am PST BY CORBIN DAVENPORT

As Chrome Story points out, this functionality is already live in the Chrome Canary channel. There's no user-visible option for creating these links yet, but opening the custom URLs in Canary (with the above-mentioned flag turned on) scrolls to the selected text.

Source: GitHub, Chromium Gerrit

Via: Chrome Story