Sttf Url Generator Save Abandoned

A Chrome/Edge extension which generates a url with text fragment.

Project README

Archive this repo as the browsers (at least Edge and Chrome) has the functionality built-in them (e.g. Copy link to highlight).

Icon scroll-to-text-fragment url generator

build

A Chrome/Edge extension to generate the url with the scroll-to-text-fragment for the selected text. The extension will copy the url to the clipboard and open it in a new tab.

Get it from Chrome Web Store / Edge Add-ons

How to use it

how to use

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.
Open Source Agenda is not affiliated with "Sttf Url Generator" Project. README Source: chunliu/sttf-url-generator
Stars
68
Open Issues
0
Last Commit
1 year ago
License
MIT

Open Source Agenda Badge

Open Source Agenda Rating