YouTube Simple Links

By JoeSimmons Last update Jan 24, 2011 — Installed 1,391 times.

There are 3 previous versions of this script.

// ==UserScript==
// @name           YouTube Simple Links
// @namespace      http://userscripts.org/users/23652
// @description    Removes unnecessary parameters from links like feature=channel
// @include        http://*.youtube.com/*
// @copyright      JoeSimmons
// @version        1.0.2
// @license        Creative Commons Attribution-Noncommercial 3.0 United States License
// @require        http://sizzlemctwizzle.com/updater.php?id=51883
// ==/UserScript==

var array=document.evaluate("//a[contains(@href,'&') and contains(@href,'=')]",document,null,6,null),
	regex = /[&?](feature)=(channel|feed(lik|u|f|rec_grec_index))/gi;

if(!regex.test(location.href)) for(var i=array.snapshotLength-1; (item=array.snapshotItem(i)); i--) item.href = item.href.replace(regex,'');
	else location.href = location.href.replace(regex, "");