Firefox 131 released in October 2024 gained the ability to link to a specific text fragment inside a web page by including #:~:text= followed by the text fragment to link to.
But, that feature is turned off by default. To turn on this feature, first go to your about:congfig page and click through the warning. Then search for fragment in the search box.

To turn on this feature, make sure dom.text_fragments.create_text_fragment.enabled is set to true (as shown above).
Once that is done, a right-click contextual menu, Copy Link to Highlight, is now available from within any web page.
