Live data from Hacker News

Chrome will Soon Let You Share Links to a Specific Word or Sentence on a Page

chromestory.com

61–70 of 332 posts

Re: Chrome will Soon Let You Share Links to a Specific Word or Sentence on a Page

#61
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, instead 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-...

Re: Chrome will Soon Let You Share Links to a Specific Word or Sentence on a Page

#62
post #17

Earlier quoted context omitted.

in this case it looked OK > Though existing HTML support for id and name attributes specifies the target element directly in the fragment, most other mime types make use of this x=y pattern in the fragment, such as Media Fragments (e.g. #track=audio&t=10,20), PDF (e.g. #page=12) or CSV (e.g. #row=4). fragments is already there but most pages do not have a clickable ID attribute. If Chrome could automatically provide…

> in this case it looked OK That’s not really the point

I’m fine skiing down this slippery slope

Re: Chrome will Soon Let You Share Links to a Specific Word or Sentence on a Page

#63
post #3

I can't find an RFC about this, but it looks like something similar has been proposed in the past, with a slightly different API. > In URIs for MIME text/plain documents RFC 5147 specifies a fragment identifier for the character and line positions and ranges within the document using the keywords "char" and "line". Some popular browsers do not yet support RFC 5147.[5] The following example identifies lines 11 through…

I must say I prefer the RFC version - while still vulnerable to rotting from text changes, at least it should still link to the same general vicinity.

HTML documents don't generally have the concept of lines since text reflow based on the way user agent (browser) is rendering the document. That's why the RFC only talks about text/plain MIME type - browsers render those with all line breaks intact. You can maybe use a CSS selectors, but that adds a tremendous amount of complexity and is not easy for non-web developers to read anymore.

Re: Chrome will Soon Let You Share Links to a Specific Word or Sentence on a Page

#64
post #14

It seems like more and more, Google is leveraging their near-monopoly on web browsing to just skip the proposal process and do whatever they want without discussion.

That’s exactly what I would do in the same shoes I think. Proposals are cool and I understand why it is better for an open web etc… but getting features immediately is pretty cool too.

Re: Chrome will Soon Let You Share Links to a Specific Word or Sentence on a Page

#65

Earlier quoted context omitted.

If building from scratch maybe, but when was the last time a browser was built from scratch? Even Chromium was forked from WebKit.

But since when is it a good thing that the last time someone managed to build a web render engine from scratch was thousands of years ago?

Hopefully Mozilla will have some luck modernizing by replacing pieces one at a time with Rust components. ;)

Re: Chrome will Soon Let You Share Links to a Specific Word or Sentence on a Page

#66
post #46

Earlier quoted context omitted.

Stagnation is not always bad. For one, it helps keep complexity down. We're at a point where building a browser is impossible unless you have literally millions and millions of dollars to invest. That is not good.

Why is the possibility of a wheel being reinvented a desirable thing?

Because competition is good?

Re: Chrome will Soon Let You Share Links to a Specific Word or Sentence on a Page

#67
post #61

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…

> (Believe it or not, I still see new projects use this over the history API!)

want to guess which one doesnt need JS, or server-side handling to work?

Re: Chrome will Soon Let You Share Links to a Specific Word or Sentence on a Page

#68
post #9

Very significant limitation: it only links to the first instance of the target text. What is the expected behavior if you highlight a second instance of some target text and try to create a link to it? It’s bad that the spec doesn’t discuss it. I can see this happening with short selections, like linking to a single word. Seems like this could use more thought.

Yeah needs something like occuranceNumber=5 I.e. navigate to the fifth occurance

Re: Chrome will Soon Let You Share Links to a Specific Word or Sentence on a Page

#69

Earlier quoted context omitted.

With AMP they are trying to become the web.

What does that even mean? AMP is built on WebComponents, which are an existing web standard. That's no less standard than anything else using custom elements.

This guy AMPs

Re: Chrome will Soon Let You Share Links to a Specific Word or Sentence on a Page

#70
post #14

It seems like more and more, Google is leveraging their near-monopoly on web browsing to just skip the proposal process and do whatever they want without discussion.

web standards are descriptive not prescriptive, and have always been: nobody asked before adding the tag to their web browser, it was just added (and later removed) after it was used by more than one implementation and consensus was found how it's supposed to behave.

For example, WebSQL died because there was only one implementation: implementations come before the standards.

Post reply on HN