YouTube Simple Links

By JoeSimmons Last update Nov 10, 2009 — Installed 333 times. Daily Installs: 0, 1, 0, 1, 2, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 15, 29, 7, 12, 8, 6, 3, 2, 3, 4, 2, 5, 8, 5, 3, 3

There are 1 previous version 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.1
// @license        Creative Commons Attribution-Noncommercial 3.0 United States License
// ==/UserScript==

var array=document.evaluate("//a[contains(@href,'&') and contains(@href,'=')]",document,null,6,null),
	regex = /[&?](feature)=[^&]*/gi;

if(!/https?:\/\/(.*\.)?youtube\.com\/.*&(feature)=.*/.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, "");
}