bgoodr
bgoodr

Reputation: 2930

Linking to a specific part of a web page that lacks an applicable anchor

Linking to a specific part of a web page and Is there any way to bookmark or link to a section of a page without an anchor? have answers/comments that say that linking to a particular part of a page cannot be done unless that page has addressable items in it such as anchors.

But I'm really needing this for research: I need to paste URLs to any arbitrary section in any arbitrary page without requiring that page to have anchors (e.g., I would like a URL that essentially goes to http://www.zdnet.com/article/google-voice-beyond-gmail-get-voicemail-and-texts-using-any-email-client-you-want/ and searches down for "Filters are your friends")

I need this to work in a browser-agnostic manner, not requiring browser extensions (e.g., http://liveurls.mozdev.org/tech.html as referenced by https://stackoverflow.com/a/26590905/257924), not requiring use of Javascript inside the URL itself which will not execute due to obvious and correct security concerns, and not requiring cross-site scripting (https://stackoverflow.com/a/13294569/257924).

Is there some other way to do it such as some external website that provides a way to form a link to an arbitrary string of text within a page when that page lacks an anchor?

Upvotes: 2

Views: 1360

Answers (1)

Miller
Miller

Reputation: 33

Chrome(later than 74.0.3706.0) has an experimental feature ScrollToTextFragment which does exactly what you want

To enable scrolling directly to a specific part of a web page, we propose generalizing the existing support for scrolling to elements based on the fragment identifier. We believe this capability could be used by a variety of websites (e.g. search engine results pages, Wikipedia reference links), as well as by end users when sharing links from a browser.

...

Links are sometimes used as citations in web pages where the author wishes to substantiate a claim by referencing another page (e.g. references in wikipedia). These reference pages can often be large, so finding the exact passage that supports the claim can be very time consuming. By linking to the passage that supports their underlying claim, authors can make it more efficient for readers to follow their overall argument.

but the user have to turn on this experimental feature manually.

This feature is currently implemented as an experimental feature in Chrome 74.0.3706.0 and newer. It is not yet shipped to users by default. Users who wish to experiment with it can use chrome://flags#enable-text-fragment-anchor. The implementation is incomplete and doesn't necessarily match the specification in this document.

Upvotes: 3

Related Questions