Google: What are you thinking?

Apparently some time within the last couple of weeks, Google changed the way links work on their search results pages, such that dragging and dropping a link from a search result into another browser window no longer works in Safari. I have yet to test this in other browsers or on Windows, but even this Safari breakage seems pretty irresponsible to me.

So what did they do? It seems that they’ve added an onmousedown JavaScript handler to all of the links on their search result pages. Unfortunately this seems to break Safari’s Drag-n-Drop. The links can no longer be dragged at all because the onmousedown event is trapped before the Drag-n-Drop handler gets to have control of the mouse button event. Whoops!

The onmousedown code looks like this:

<a href=... onmousedown="return asq(event,this,'res','11','')">...

The ‘res’ appears to mean “result”, and the ’11’ is the number of the search result. The first one on the result page is ‘1’, the next is ‘2’, etc.

So what exactly does the asq function do? Well, here it is, formatted so that there’s a chance a sane coder can actually understand what’s going on:

Basically what this seems to do is make a new HTTP GET request to the Google server when you click on a link in the search results. The URL of the request looks like this:

http://www.google.com/url?sa=T&ct=res&cd=1&url=[[theResultURL]]&ei=xlkCQ92dIob6sQHLq_zGDg

… With the cd parameter being the index of the search result, and [[theResultURL]] being the URL that the search result links to. I have no idea what the sa and ei parameters mean, though it’s probably safe to assume that sa has something to do with localization and ei is some sort of unique session key.

My best guess is that Google is using http://www.google.com/url… to track click-throughs, presumably so that they can improve the PageRank of the page the search result links to, but this is only a guess.

So I’m left with two questions for Google: How are you using this new click-through data? – and – When the heck do I get my link Drag-n-Drop back in Safari? It’s part of my regular work-flow, and I miss it. Badly.

3 Comments

  1. Jake Savin said:

    Cool. So this is a bug in Safari you think, and not a Google bug? I think Google should have caught this either way, but maybe they did, and they decided that it wasn’t their bug so screw it. If that’s the case, I bet they would have done something about it if it had been a problem for IE on Windows.

    Anyway, hopefully it’s easy enough to fix. Glad I may have been some help. 🙂

    August 17, 2005
    Reply
  2. Bakafish said:

    Good catch, I was just as pissed as you were about the dumb change. I was trying to isolate the problem myself, when I narrowed it down to the main links in Google. Now if we only had a nice client side code injection system like http://greasemonkey.mozdev.org/ for Safari we could just redefine the stupid function. Hope someone fixes it soon.

    August 19, 2005
    Reply

Leave a Reply to Bakafish Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.