Userscripts.org Remove 'Share' From Right Nav

By Erik Vold Last update Dec 19, 2009 — Installed 105 times.

There are 2 previous versions of this script.

// ==UserScript==
// @name			Userscripts.org Remove 'Share' From Right Nav
// @author			Erik Vergobbi Vold
// @namespace		usoRemoveRightShareCrap
// @include			http://userscripts.org/scripts/show/*
// @match			http://userscripts.org/scripts/show/*
// @version			0.1.2
// @license			GPL version 3 or any later version; http://www.gnu.org/copyleft/gpl.html
// @datecreated		2009-10-24
// @lastupdated		2009-12-18
// @description		Removes the 'Share' crap from the right menu on userscript pages of userscripts.org
// ==/UserScript==

(function(){
	var share=document.evaluate("//h6[contains(text(),'Share')]",document,null,9,null).singleNodeValue;
	if (!share) return;
	var p=share.parentNode;

	var end=document.evaluate(".//.[@id='fans']",p,null,9,null).singleNodeValue;
	if (!end) {
		end = document.evaluate(".//h6[contains(text(),'Groups')]", p, null, 9, null).singleNodeValue;
		if (!end) {
			end = document.evaluate(".//h6[contains(text(),'Admin for script')]", p, null, 9, null).singleNodeValue;
			if (!end) {
				end = document.evaluate(".//h6[contains(text(),'Tags')]", p, null, 9, null).singleNodeValue;
				if (!end) return;
			}
		}
	}

	var next=share,cur;
	while(next!=end){
		cur=next;
		next=cur.nextSibling;

		p.removeChild(cur);
	}
})();