Text Fragments


Google is prepping a new hyperlink model that will permit Chrome users to hyperlink not just a web page, but also to any particular textual content on a web page, which is robotically highlighted.

The new model is referred to as “Text Fragments” and it's more like an anchor hyperlink, but can be created by anybody and with highlighting feature. While the capabilities are already supported in Chrome since version 80, Google is looking to bring it via Chrome extension which makes it easier to create, and works for everyone using Chrome.

The company has submitted a proposal of the new concept to the W3C and hopes other browser vendors will also undertake to implement it, albeit the hyperlinks are backward-compatible.

How the Text Fragments hyperlink model works?



The process for Text Fragments is within the string “#:~:textual content=” which the textual content need to match, and full hyperlink would always appear like this:

https://en.wikipedia.org/wiki/Dog#:~:text=A common breeding practice for pet dogs is mating between close relatives


If you copy and paste the above URL into Chrome, the browser will open Wikipedia’s dog page, and scroll to the primary textual content that matches “A common breeding practice for pet dogs is mating between close relatives,” and highlights it. But if the textual content does not match anything, the page will still load all the same.

The backward-compatibility is as a result of browsers assist of the quantity signal (#) as a URI fragment, which it uses for anchor hyperlinks. And if you paste the URL right into a browser that does not support the assist, the page will still load, and the quantity signal will simply be ignored as an anchor hyperlink.

What's the Drawback of the Text Fragments model?



The only drawback of this model is that it implies you can have areas in a URL, a webpage or discussion board, which you possibly can hand-code the hyperlink with a href tag regardless of the non-HTML and it will still work.

Although, for messengers and social media which do not enable code or use automated URL parsers, things can get a bit more sophisticated. As each URL parser treats an area as the top of the URL, so you'll have to make use of the percent-encoding to switch all of the areas with the equal “%20.”

But, the new Chrome extension, known as “Link to Text Fragment” which is also available on Github will put a brand new entry in Chrome’s right-click menu. So that users can simply spotlight textual content on a web page, right-click and hit “Copy hyperlink to chose textual content.” And just like magic, a textual content fragment hyperlink will find itself in your clipboard.

With this, all of the textual content encoding will be done robotically, so that the hyperlink will work with most websites and messengers.

Google's push for new hyperlink model via Chrome extension

Text Fragments


Google is prepping a new hyperlink model that will permit Chrome users to hyperlink not just a web page, but also to any particular textual content on a web page, which is robotically highlighted.

The new model is referred to as “Text Fragments” and it's more like an anchor hyperlink, but can be created by anybody and with highlighting feature. While the capabilities are already supported in Chrome since version 80, Google is looking to bring it via Chrome extension which makes it easier to create, and works for everyone using Chrome.

The company has submitted a proposal of the new concept to the W3C and hopes other browser vendors will also undertake to implement it, albeit the hyperlinks are backward-compatible.

How the Text Fragments hyperlink model works?



The process for Text Fragments is within the string “#:~:textual content=” which the textual content need to match, and full hyperlink would always appear like this:

https://en.wikipedia.org/wiki/Dog#:~:text=A common breeding practice for pet dogs is mating between close relatives


If you copy and paste the above URL into Chrome, the browser will open Wikipedia’s dog page, and scroll to the primary textual content that matches “A common breeding practice for pet dogs is mating between close relatives,” and highlights it. But if the textual content does not match anything, the page will still load all the same.

The backward-compatibility is as a result of browsers assist of the quantity signal (#) as a URI fragment, which it uses for anchor hyperlinks. And if you paste the URL right into a browser that does not support the assist, the page will still load, and the quantity signal will simply be ignored as an anchor hyperlink.

What's the Drawback of the Text Fragments model?



The only drawback of this model is that it implies you can have areas in a URL, a webpage or discussion board, which you possibly can hand-code the hyperlink with a href tag regardless of the non-HTML and it will still work.

Although, for messengers and social media which do not enable code or use automated URL parsers, things can get a bit more sophisticated. As each URL parser treats an area as the top of the URL, so you'll have to make use of the percent-encoding to switch all of the areas with the equal “%20.”

But, the new Chrome extension, known as “Link to Text Fragment” which is also available on Github will put a brand new entry in Chrome’s right-click menu. So that users can simply spotlight textual content on a web page, right-click and hit “Copy hyperlink to chose textual content.” And just like magic, a textual content fragment hyperlink will find itself in your clipboard.

With this, all of the textual content encoding will be done robotically, so that the hyperlink will work with most websites and messengers.

No comments