[Tip] Enable and Use Scroll to Text in URL Fragment in Google Chrome

Google Chrome newer versions come with a very useful and hidden secret feature called “Text URL Fragment” or “Text Fragment Anchor” which helps users in specifying one or more words in a web page URL and directly scrolling to the specified text present anywhere on the web page.

For example, a web page contains a word CCleaner and you want to directly go to the paragraph or location containing CCleaner word as soon as you open the web page. In such case with the help of this feature, you can specify CCleaner word in the URL and when you’ll open the URL, Google Chrome will automatically scroll to the paragraph or location where CCleaner word is written. It’ll also highlight the word so that you can easily find out it as shown in following screenshot:

Scroll_Text_URL_Fragment_Anchor_Google_Chrome.png

Advertisement

This feature is not enabled by default and you need to activate and enable it manually by modifying a built-in preference or flag in Chrome.

In this tutorial, we’ll tell you how to enable this scroll to text in URL fragment feature in Chrome and how to use it on web pages.

STEP 1: Enable Text URL Fragment Anchor Feature in Chrome

1. Open Google Chrome web browser and type chrome://flags/ in addressbar and press Enter. It’ll open the advanced configuration page.

2. Now type text fragment in the “Search flags” box.

It’ll directly go to following option:

Enable Text Fragment Anchor.
Enables scrolling to text specified in URL’s fragment. – Mac, Windows, Linux, Chrome OS, Android
#enable-text-fragment-anchor

3. To enable the feature, select Enabled from the drop-down box.

Advertisement

Enable_Text_URL_Fragment_Anchor_Google_Chrome.png

4. Google Chrome will ask you to restart the browser. Click on “Relaunch now” button to restart Google Chrome.

That’s it. You have successfully activated and enabled text URL fragment feature in Google Chrome.

STEP 2: Use Text URL Fragment Anchor Feature in Chrome

Once you enable the feature, you need to learn how to use this feature.

We need to use a parameter #targetText= in URLs followed by our desired word in web page URLs so that Google Chrome can directly scroll to the word present on the web page.

NOTE: I checked and found that the parameter is case-sensitive and must be targetText and not TargetText, targettext, Targettext, etc.

You need to append the parameter at the end of the web page URL. For example, we want to directly go to and highlight “problems” word on AskVG homepage, then we’ll use following pattern of URL:

https://www.askvg.com/#targetText=problems

Make sure there is a / before #targetText= parameter.

That’s it. Open the URL in Chrome and it’ll directly scroll to the desired word and will also highlight it.

PS: If you want to disable the feature in future, select “Disabled” option from the drop-down box and restart the browser.

Published in: Google Chrome

About the author: Vishal Gupta (also known as VG) has been awarded with Microsoft MVP (Most Valuable Professional) award. He holds Masters degree in Computer Applications (MCA). He has written several tech articles for popular newspapers and magazines and has also appeared in tech shows on various TV channels.

Comments

NOTE: Older comments have been removed to reduce database overhead.

  1. for firefox, there is an addon called “Precise Links”. its much easier to use, just select text and right click and there is an option to copy text fragment

Leave a Comment

Your email address will not be published. Required fields are marked *

NOTE: Your comment may not appear immediately. It'll become visible once we approve it.