Skip to content

TIL: Firefox's 'Copy Link to Highlight'

TIL that Firefox supports copying a text fragment.

Don't shame me for just finding out about this! 🙈

There are times when I want to copy a link to a specific sentence or paragraph of technical documentation, but the content in question is not anywhere near an element with an ID that can be used as anchor. Text fragments make it possible to tell the browser to highlight and scroll to a specific selection text.

I primarily use Firefox, where support for text fragments URLs was added in version 131.0, and a "Copy Link to Highlight" option was added to the context menu (i.e. what you get you right-click on a page) in version 145.0.

"Copy Link to Highlight" in Firefox context menu
A screenshot of the "Text Fragments" page on the Mozilla Developer Network website, showing the "Not all documents have such anchors" text highlighted and the context menu, where the mouse is hovering over the "Copy Link to Highlight" option.

All common desktop and mobile browsers seem to support both text fragments and a feature similar to Firefox's "Copy Link to Highlight".

Extra

Examples using some famous quotes: