Monday, December 14, 2009

Google Search Link Copier

One of the greasemonkey scripts that I wrote was a utility that modifies the Google search result page. By default, the URLs of search items on the results page change to a Google Url when the results are clicked. Hence, when you visit a website from the search engine, you path is tracked. This is a good behavior for Web History, but does not play well while copying or dragging the link content. This does not work when the user navigates using the keyboard.
This post is about the update to the script that existed earlier. Apart from checking for automatic version update, the script has been simplified a lot. Google's search page has a "onMouseDown" event attached to all search results that change the URL. However, if the user is dragging the link as a bookmark or to a chat session to paste it, google's redirect URL is pasted instead of the actual page location. I am not sure why it is attached to the "mouseDown". I think it makes more sense in the "click" event.
This script adds an event handler to "mouseDown" that nullifies the link change by the page's script. It also attaches an "click" handler that restores the link that Google wants, for Web History's sake. I have also added the scriptUpdateChecker that checks for new versions of scripts. There is some discussion about this here, and I would update it once a conclusion is reached. Watch out this space for more updates.

4 comments:

  1. hi, how can i activate this script for http://www.google.de/ .

    I have already tried to change the "Include Pages" URL to http://www.google.de/*. But this is not working.

    Do you have other ideas?

    Sunny
    ReplyDelete
  2. @Sunny
    When you click on the greasemonkey icon, do you see the name of the script listed ?
    Is the script not enabled, or the functionality not working ?
    ReplyDelete
  3. The script is enabled for google.de (listed in Greasemonkey), only the functionality is not working.

    After changing the URL the script is still working for google.com. But no effect on google.de.
    ReplyDelete
  4. Hi Parashuram, the script is no longer working. Can you update it?
    ReplyDelete