Live data from Hacker News

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

chromestory.com

221–230 of 332 posts

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

#221

Earlier quoted context omitted.

> It's an abuse of the purpose of URL fragments So what they're saying is, they expect a clash of their abuse of URL fragments with others' abuse of URL fragmentsto be rare because... The arrogance here is astounding: "It's OK for us to use this, because others shouldn't be using it"

Aren't url fragment originally used for page position already? Like url.com/#title would scroll to the page the div with id "title"? In that case I don't feel like using url fragment for a word position is so much breaking it, it keeps the use of url fragment for info about page position, right?

Yes but this is about namespacing/syntax and likelihood of clashes.

Normally, url fragments were intended to be used by page authors, making clashes impossible (page author controls both page and anchor syntax). Google are breaking this contract, but argue that the fact that they're using parameter-style syntax should not clash with author usage, because using parameter-style syntax is "an abuse" of the feature.

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

#222

Earlier quoted context omitted.

Such fragments don’t need to be particularly human-readable, only machine-readable. Given that, greater flexibility is generally a virtue: different matching strategies will work better in different contexts, and different tools can benefit from it. Consider the increased scope of the annotations feature—it’s designed for things like more robust referencing, bookmarking with annotations and other things like that. Th…

it adds a huge amount of unnecessary complexity for such a simple feature There is a reason nobody implemented the W3C proposal, If I have the choice between a simple working solution that anyone can describe in a single sentence specification and a hundred page specification with tons of unneeded features that nobody is going to implement ever, I choose the former. I wonder how much hate Mozilla would've gotten for…

No, Mozilla would've gotten plenty of hate for potentially breaking sites, and adding features without discussing things with other vendors and Internet bodies. The thing is, we all know that Mozilla can't get away with that, but Google can, given Blink's market dominance.

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

#223
post #161

Earlier quoted context omitted.

the issue is that your server now needs to somehow understand which part of the path is the "fragment" without any distinguishing characters by which to parse it out of the url. if the server now sees deep urls like `/products/patagonia/parkas`, how does it know which part is the fragment? is it /parkas or /patagonia/parkas? what if you have urls that are not completely uniform? or have different uniformity at differ…

Point isn't so much that the server needs to do anything, you can still just serve up the same response no matter the path, and have the client render different results – just as you would with a shebang style navigation in the past. The difference is that you know have options, which you didn't before since the server never saw the fragment part of the url, only / or /entry-point or whatever. So you can have more co…

Lots of (mostly free) hosting just serves the files you upload, so that wouldn't work unless you copied the files to be served at every possible route.

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

#224

Earlier quoted context omitted.

> what people click on email, thanks to gmail rewriting all links to a google track url (while misleading the user by a fake status text on mouse over) They use the same trick for Google Search in a way that is transparent to the user - as long as you have JS turned on. When you switch it off, you realize instead of clicking on HNs URL, you actually click https://www.google.com/url?q=https://news.ycombinator.com/&s..…

Actually, it seems like the you click on Google Search has the right href (which is what appears on the status text) but it also has a ping attribute to it for tracking. https://www.w3schools.com/tags/att_a_ping.asp

I'm surprised there is not a chrome extension to remove these.

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

#225
post #109

Technical question, apart from the (valid IMO) political arguments: Google's idea to implement this is to append the text fragment to the URL in a "#targetText" pseudo-query-argument in the URL fragment part. This sounds like it would extremely easily break existing web pages who use the fragment part for their own state. In the blog post, there doesn't seem to be anything addressing this (or even just specifying how…

Couldn't they put this in a second fragment? #pageNavigation=home##targetText=foo

That way both could live together, if the page uses # in the fragment, just percent encode it.

At most this would break old bookmarks.

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

#226
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?

Is a browser really a "wheel"? There are so many choices to make, so many lines drawn in the sand. And besides, you really don't want the marketing and tracking giant Google to make all the decisions regarding the software that delivers so much content to billions of users' screens, do you? They've been okay so far, but there's a huge conflict of interest here.

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

#227

Earlier quoted context omitted.

Aren't url fragment originally used for page position already? Like url.com/#title would scroll to the page the div with id "title"? In that case I don't feel like using url fragment for a word position is so much breaking it, it keeps the use of url fragment for info about page position, right?

Yes but this is about namespacing/syntax and likelihood of clashes. Normally, url fragments were intended to be used by page authors , making clashes impossible (page author controls both page and anchor syntax). Google are breaking this contract, but argue that the fact that they're using parameter-style syntax should not clash with author usage, because using parameter-style syntax is "an abuse" of the feature.

This is a good point, which I didn't get until your comment. I think they should surface this on that page, because it seems everyone is thinking this will be a big clash, but as you say, if someone shares a sentence, the likelihood is low.

To double check, does this means things like,

  https://www.spa/#!/path/to/view
Can become

  https://www.spa/#!/path/to/view&targetText=percent%20encoded
The only part I don't get about the likelihood and this extension is how it interacts with these kind of hash routes.

I haven't thought that much about the next part, but how do people feel about the following?

  web+text://https://www.spa/#!/route/to/view#targetText=percent%20encoded
or something. Rather than extending URLs vertically, extend horizontally into a different protocol the URI of which can encode the syntax elegantly.

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

#228
post #161

Earlier quoted context omitted.

Point isn't so much that the server needs to do anything, you can still just serve up the same response no matter the path, and have the client render different results – just as you would with a shebang style navigation in the past. The difference is that you know have options, which you didn't before since the server never saw the fragment part of the url, only / or /entry-point or whatever. So you can have more co…

Lots of (mostly free) hosting just serves the files you upload, so that wouldn't work unless you copied the files to be served at every possible route.

“#” Fragments aren’t sent to the server at all. They are ONLY used to get to a specific anchor (old school) or processed by JavaScript to do something (often fake navigation by showing and hiding content). This article is adding a 3rd magic use for them.

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

#229

Earlier quoted context omitted.

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.

Oops, good point. I suppose you could do by newline/paragraph plus character instead, but that would be even more vulnerable to text changes.

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

#230
Why aren't XPointer/XPath fragments used instead of yet another half-backed reimplementation of the same concept?

XPointer and XPath have been ratified by the W3C in (...checks...) 2003. They have since been revised, slimmed down and used in countless XML-based applications and specs.

The cool thing about XPointer is that it is basically impossible that its fragments are already used in the target document. No site would break if XPointer were used.

Examples of XPointers:

* Pointer to _all_ the occurrences of "target text" anywhere in the page (goodbye JS-inserted )

#xpointer(string-range(//,"target text"))

Pointer to all occurrences of "target text" in a

in the article

#xpointer(string-range(//main//p,"target text"))

* Pointer to the second heading

#xpointer(//h2[2])

* Pointer to that specific bullet point that you want your colleague to change ASAP

#xpointer(//ul[7]/li[3])

* Abbreviated fall-back to XPath

#//ul[7]/li[3]

Post reply on HN