Google Search Privacy

If you are a web master, you know that Google tells you “top search queries” and also “top search query clicks” and the corresponding “average top position” for each of those queries. As a web master, I am sure you would love this information. But if you are the end user doing those queries?

Let’s take a pause and see, what these two types of information are. One gives the position of your web page for the searches that are conducted while the other gives the position of your web page when the user actually clicked on your web page in the search results. The first piece of information is simple and straightforward. However, how it possible to get the second piece? The only ways it’s possible is by tracking the clicks by the users.

Recently, Google’s search results also has “View and manage your web history” link on the top of the page. I personally can’t understand why people want to keep track of what they have searched in the past. No one really wants that, especially if they are concerned about privacy.

So, how is it possible to track the clicks? If you actually see the search result links, they have the standard href=link syntax. So, the link itself is directly pointing to the website itself and so when you place the cursor on top of the link, you do get the link in the status bar. However, there is also the onmousedown event that actually routes the click through a function that hijacks the original link and replaces it with a redirect through Google. That’s how Google knows about the click.

So, if you are over cautious about privacy, what would you do? I have searched userscripts.org for any GreaseMonkey’s user scripts that fix this issue. One seemed to fix the issue, but the way it did it was to register an additional event listener that sets the link back to the original. The reason why that author had to do it that way is perhaps, from within GreaseMonkey scripts, it’s not possible to directly alter the events. Instead, one has to use the addEventListener to register an additional listener. So, it’s not possible to prevent the listener set by the original content.

While the above way of resetting the link back to the original link is fine, the way I addressed this problem is with a oneliner. It is


unsafeWindow.clk = function() { };

That’s it. What this does it, it replaces the window.clk function of the results document that’s called from the onmousedown event listener with a different function that does nothing. Ofcourse, this is specific to Google and the earlier idea of resetting the link may work as a generic case.

Advertisements

Leave a comment

Filed under Google, Google Search Privacy

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s