What are the benefits of the two solutions, given that both rely on Javascript? Maybe an AJAX call could be cancelled when browser follows the link?
P.S. I believe Google has been doing rewriting since long before 2011, IIRC.
Otherwise the onmousedown solution (which Google abandoned) would be strictly superior.
Honestly, given the behavior of when Google chooses to deploy this feature, I believe it to be an unintended bug. I believe that Google's intention with these links is for them to work as normal: to be simple <a href="http://example.com/>, and to only change as you click on them to go to the next page.
This would then explain why they require JavaScript: in order to pull off the feat of having the link work correctly normally but only change as you click it requires JavaScript; that then explains why they only serve this to clients that have JavaScript.
If you check the link out: they actually are shipped from Google as simple anchor tags. They they have an "onmousedown" that converts the link to a Google indirect URL only as they are clicked. With the caveat that this makes clicking the links really slow (due to the synchronous round trips to Google that sometimes even fail due to SPDY), this would seem to be ideal behavior.
However, right-clicking the URL, or clicking on the link and dragging it, also cause the link to be changed to the indirect URL. This could very well have simply been an oversight: a mistake caused months (even years) after they originally deployed this feature, and no one noticed or remembered it shouldn't work like that.
(edit: Hacker News seriously won't let me put a closing " on the href= of my <a> example tag... :(.)
Let me alternatively put it this way: for the same reason (that search is their main product, that linked results are a huge part of it, and that theoretically they care a lot to make the experience of that work really well), I'd be shocked if this isn't a "bug"... the idea that this behavior would be considered a feature is simply awkward.
That said, I now have managed to find a reference (linked above in this thread) to someone from the Google Analytics team describing why the /url feature was put into place, and it definitely sounds like something that wasn't given /that/ much thought.
(Specifically, that they broke analytics tracking systems, including Google Analytics, when they launched the AJAX search results pages: hash anchors are not sent as part of a Referer:. It then sounds as if the Analytics team sent a nastygram to the search team, who threw in a patch to make the Analytics team stop yelling at them. ;P)
http://analytics.blogspot.com/2009/04/upcoming-change-to-goo...
(edit:) One of the comments from "Brett Crosby, Sr. Manager, Google Analytics" looks interesting:
"""Sorry for the delay in responding (especially Andre), I was seeking clarification from the search team. A lot of the comments were directed to them and I think it is best to let that team handle those questions. I do want to answer some of the Analytics questions though. Phil's comment above is correct. I posted this because a couple months ago Google tested some search results that added a # into the URL. This created a big problem for people interested in seeing which keywords were driving traffic to their site (anything in the URL after a # doesn't get passed in the referrer... this is particularly a problem for web analytics products), so we worked with the search team to stop that test until they could find a better solution. The announcement above is the answer to that. It allows them to test new search results without the negative side effects (if it introduced others, that was not the intent). Some of the other comments had interesting theories about why we did this (grassy knolls not included), but the goal was to allow new tests of search without making it difficult for analytics products to report on query data."""
The post he is talking about from Phil, for reference:
"""I have previously heard about (from various sources) the intent by Google to roll-out a hash '#' in the search results page URL that would strip the paramaters altogether - is this blog entry implying that this will not happen now?? or is this something different?"""
This also puts forward an alternative explanation for why this is served only to JavaScript-capable clients than my theory below (which was that the goal was to use JavaScript to make the behavior transparent, but that that intention failed at a later point and was not noticed).
Honestly, this new explanation makes even more sense, now that I notice that the search query no longer exists in the Referer: portion of the /webhp URL that is being used for the super-fast AJAX Google search pages they have been deploying for a while now.
(That said, it is still really weird that they choose to hide the behavior until onmousedown; the only reason it would seen beneficial to do that is if they wanted to make the behavior transparent, and the way it is currently implemented seems to fail to do that: interacting with the link at all causes the URL to change to a /url URL.)