STTF Url Generator Extension for Chrome/Edge
Privacy Policy
This browser extension helps you create a url with a text fragment. With this url, the browser will automatically scroll to and highlight the text fragment on the page, so users will be able to locate the information on the page more quickly and accurately. It is useful when you want to share with others the specific information with a link.
How to use it
Get the extension from Chrome Web Store or Edge Add-ons.
1. Copy or Open the URL
- Select a text snippet on the page and right click on the selection.
- Point to
STTF Link
on the context menu. - Click
Copy
if you want to copy the sttf link without opening it. - Click
Open
if you want to open the sttf link in a new tab. The link will also be copied to the clipboard.
2. Copy the URL as Markdown
- Turn on the
Copy As Markdown
option from the browser’s toolbar. - Select a text snippet on the page and right click on the selection.
- Select
STTF Link
>Copy as MD
.
3. Multiple Text Fragments in One URL
- Select the 1st text fragment and click
STTF Link
>Open
to open it in a new tab. - In the new tab, select the 2nd text fragment and then choose either
Open
orCopy
to get the URL. - If there are more text fragments to be selected, repeat the above steps until all text fragments are covered.
How it works
The extension works in the following way.
- Following the suggestion of the text fragments spec, when the selection of the text snippet has less than 300 characters, the url will be generated with exact matching.
- If the text snippet has 300 or more characters, the url will be generated with range-based matching.
- For range-based matching, the first 5 words of the text snippet will be used as textStart, and the last 5 words will be used as textEnd.
Note
- According to the spec, the selection of the text snippet must adhere to the word boundaries. In another words, the selection needs to start from the beginning of the first word and end at the ending of the last word of the text snippet. If the selection starts or ends at a character in a word, the browser would not be able to find the matching accurately. With v1.3, the extension helps to snap the selection to word.
- Due to the algorithm of finding ranges in a document, the selection of the text snippet should avoid crossing multiple “block-level” elements. For example, if a selection is across a
<h2>
and a<div>
, the browser may not be able to scroll to the text fragment accurately.