HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
bokand
ScrollToTextFragment
HTML2019–2019
bokand / ScrollToTextFragment

ScrollToTextFragment

Proposal to allow specifying a text snippet in a URL fragment

3Distinct people
5Mentions
0Explicit recommenders
14GitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

Proposal to allow specifying a text snippet in a URL fragment

GitHub

Where it is used

No documented product use has been verified yet.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 3:56:07 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by hour5 dated mentions

Observed mentions: 2019-02-15 07:04:15 UTC to 2019-02-15 17:10:36 UTC.

0122019-02-15 07:00:00 UTC to 2019-02-15 08:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 commentsFeb 15, 07:002019-02-15 08:00:00 UTC to 2019-02-15 09:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2019-02-15 09:00:00 UTC to 2019-02-15 10:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2019-02-15 10:00:00 UTC to 2019-02-15 11:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2019-02-15 11:00:00 UTC to 2019-02-15 12:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2019-02-15 12:00:00 UTC to 2019-02-15 13:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 commentsFeb 15, 12:002019-02-15 13:00:00 UTC to 2019-02-15 14:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2019-02-15 14:00:00 UTC to 2019-02-15 15:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2019-02-15 15:00:00 UTC to 2019-02-15 16:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments2019-02-15 16:00:00 UTC to 2019-02-15 17:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2019-02-15 17:00:00 UTC to 2019-02-15 18:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 commentsFeb 15, 17:00

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
Feb 15, 07:002019-02-15 07:00:00 UTC2019-02-15 08:00:00 UTC101
Feb 15, 08:002019-02-15 08:00:00 UTC2019-02-15 09:00:00 UTC000
Feb 15, 09:002019-02-15 09:00:00 UTC2019-02-15 10:00:00 UTC000
Feb 15, 10:002019-02-15 10:00:00 UTC2019-02-15 11:00:00 UTC101
Feb 15, 11:002019-02-15 11:00:00 UTC2019-02-15 12:00:00 UTC000
Feb 15, 12:002019-02-15 12:00:00 UTC2019-02-15 13:00:00 UTC000
Feb 15, 13:002019-02-15 13:00:00 UTC2019-02-15 14:00:00 UTC000
Feb 15, 14:002019-02-15 14:00:00 UTC2019-02-15 15:00:00 UTC000
Feb 15, 15:002019-02-15 15:00:00 UTC2019-02-15 16:00:00 UTC202
Feb 15, 16:002019-02-15 16:00:00 UTC2019-02-15 17:00:00 UTC000
Feb 15, 17:002019-02-15 17:00:00 UTC2019-02-15 18:00:00 UTC101

What Hacker News says

5 sources
Which is exactly why we build an experiment first, to find potential issues before shipping. If you do see a page that you think might break and you're on Chrome newer than 74.0.3706.0, try turning on chrome://flags#enable-text-fragment-anchor and giving it a try. If something looks out of place, that would be extremely useful data for us. File a bug either at https://github.com/bokand/ScrollToTextFragment/issues or https://crbug.com/new
In Chrome will Soon Let You Share Links to a Specific Word or Sentence on a Page
Feature author here. I'd like to first clarify that this is still in the super-early stage of development; none of this is shipped or finalized yet. The feature hasn't even requested approval to ship at which point these kinds of issues would be brought up. We take web-compat very seriously. If this breaks even a small percentage of pages, it won't ship. Part of the shipping process is ensuring we have at least a draft spec (W3C,WHATWG) at least some support from other vendors. Sorry, the explainer text came off more dismissive than I intended. I wanted to get something implemented so we could start experimenting and see how this would work in the wild. #targetText= is a a first attempt at syntax, any criticisms or data on how this might break would be appreciated. From my (limited) understanding of how fragments are used like this today,
Read the rest
the way this would break a page is if the page itself was using "targetText=..." and parsing the result. This is something we can and will measure and see if we have a naming collision. For pages that use a "#var=name" type fragment, we could append "&targetText=...". I'm not tied to any particular syntax here so if I'm missing why this is a monumentally bad idea, please file a bug on the GitHub repo: https://github.com/bokand/ScrollToTextFragment/issues
In Chrome will Soon Let You Share Links to a Specific Word or Sentence on a Page
Feature author here. The CSS timing attack actually influenced the design process heavily. The original design was to use a stripped down CSS selector but we found this too large of an attack surface. There's definitely still concerns around making sure a 3rd party can't exfiltrate information from the page using this but we think we've found a set of restrictions that should prevent this: https://github.com/bokand/ScrollToTextFragment#security
In Chrome will Soon Let You Share Links to a Specific Word or Sentence on a Page
"Integration with W3C Web Annotations" https://github.com/bokand/ScrollToTextFragment/issues/4 > It would be great to be able to comment on the linked resource text fragment. W3C Web Annotations [implementations] don't recognize the targetText parameter, so AFAIU comments are then added to the document#fragment and not the specified text fragment. [...] > Is there a simplified mapping of W3C Web Annotations to URI fragment parameters?
In Chrome will Soon Let You Share Links to a Specific Word or Sentence on a Page
At first glance, this seems like a really half baked idea to me. Some immediate thoughts: - Wasn't there a draft spec floating around in the early 00s that tried to accomplish this, but didn't catch on? - Fragments are already used to link to fragments, albeit more author friendly than user friendly I suppose - This won't fly very well with sites that still make use of fragment based navigation, will it? (Believe it or not, I still see new projects use this over the history API!) - What happens if there's an element in a page with the id or name `targetText`? This is not mentioned in the very tiny compatibility section[1] (where some actual data wouldn't hurt, btw) - The linked proposal[2] already mentions that more specific fragment semantics is defined in other media types, so why not follow suit and propose the HTML spec is amended, in
Read the rest
stead of making this a user agent feature? - Fragments in URLs are already pretty useless in sites that don't load content until after the dom is ready, i.e. anything that just loads a bunch of JS and then builds the site in the client – how would this fare any better? [1]: https://github.com/bokand/ScrollToTextFragment#web-compatibi... [2]: https://github.com/bokand/ScrollToTextFragment#encoding-the-...
In Chrome will Soon Let You Share Links to a Specific Word or Sentence on a Page

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.