cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Reggie
Strollin' around
Status: New idea

Currently Chrome supports the URI fragment https://en.wikipedia.org/wiki/URI_fragment#:~:text=foo which will highlight the first occurrence of the word "foo".

An improved version of this would be to automatically open the "search text within page" bar when the URI contains a fragment #:~:text=<search fragment> and put the <search fragment> into the "search text", automatically finding the first occurrence of that <search fragment>

Also, add a button the the end of the "search text within page" bar for creating the fragment URI. The button could be labelled "Permalink". On hovering over the "Permalink" button, the text "Create a permanent link to this search result on this page" would appear (or similar). On clicking the "Permalink" button, the text https://en.wikipedia.org/wiki/URI_fragment#:~:text=foo would be copied to the clipboard, and a brief (2-3 seconds) message would appear "URL with search copied to clipboard" or similar.

Possibly also include a read-only box with the URI in it. The URI changes if you change the search term.

Possibly also include a way to get to the nth occurrence of the search term. e.g. #:~:text=foo#:~:count=4

2 Comments
Status changed to: New idea
Jon
Community Manager
Community Manager

Thanks for submitting an idea to the Mozilla Connect community! Your idea is now open to votes (aka kudos) and comments.

cachi
Strollin' around

These are great thoughts and very practical UI improvements. Once basic support as in this idea and that bug is in place they should be tackled or even better included right from the start.

 @Reggie For supporting the nth ocurrence of a search term you should probably make an input directly to the WICG discussion at https://github.com/WICG/scroll-to-text-fragment/issues as it touches the fragment syntax itself. There even was a request for it, but it got closed in favor of the more powerful feature set of Web Annotations which unfortunately hasn't landed yet. As a workaround try to pick a larger fragment that is unique to the page.