Direct Linker

By ankut Last update Oct 1, 2005 — Installed 3,219 times. Daily Installs: 0, 0, 0, 0, 0, 2, 0, 1, 0, 2, 1, 0, 0, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 2, 0
// ==UserScript==
// @name          Direct Linker
// @author        ankut
// @include	  *
// @description	  Finds redirect links and replaces them with the final destination link
// ==/UserScript==

// get the links to the next pages
var links = document.evaluate("//a[@href]", document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
if (!links) return;
for (i = 0; i < links.snapshotLength; i++) 
	links.snapshotItem(i).href = unescape(links.snapshotItem(i).href).replace(/^.*\?.*(http:\/\/[^&]+).*$/i, "$1");