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");
}
