Google Search Results Sanitizer

By Anmar Mansur Last update Nov 7, 2008 — Installed 649 times. Daily Installs: 0, 1, 0, 0, 0, 1, 1, 0, 3, 3, 3, 0, 0, 1, 2, 3, 1, 3, 1, 0, 2, 4, 2, 0, 0, 2, 2, 0, 3, 1, 5, 1

There are 3 previous versions of this script.

// ==UserScript==
// @name           Google Search Results Sanitizer
// @description    Remove the redirect from Google search results, converting them to direct links.
// @include        http://www.google.com/search?*
// ==/UserScript==

var links = document.evaluate("//a[@class='l']", document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);

for (var i = 0; i < links.snapshotLength; i++) {
	links.snapshotItem(i).href = links.snapshotItem(i).href.replace(/.*&q=([^&]*)&.*/, "$1");
}