Jump to content

Use greasemonkey to remove head-fi sidebar?


Recommended Posts

Posted

They're using JoeRotate javascript, according to their code.

I'm not really a coder, but you could try being one of "those guys" that disable javascript on your browser globally. Or look for a javascript hack.

But if you stay logged in, you can just minimize all the stupid side windows they have and they remain in that state until you delete cookies. Its easy enough, that its too much hassle to seek out anything, imho.

Guest username
Posted

That's only on the home page.

The only link I really stay under is the "New Post" link, unless I search for something.

And you can't minimize that.

http://img233.imageshack.us/img233/2748/lamemv0.jpg

And btw, I saw the code they used for it, and it isn't Java: just basic html tables.

I'm going to research some more and play around with different things. I have a basic understanding of html, so hopefully it wont be too hard. If I find a solution, I'll be sure to share the goodness.

Posted

I just downloaded greasemonkey a few mins ago. Try the below script I just vomited out, with scope: http://www.head-fi.org/forums/*

Works for me. Gets rid of a couple of those top-horizontal banners too. It's an awful hack but head-fi doesn't id/name many elements for latching on to. They do like to to lots of <font> tags, though. - nice. ::)

I did notice the TTVJ sub-forum gives a JS error w/ this script because one of head-fi's startup scripts depends on one of those removed elements...let it choke...not a big deal to me.

// ==UserScript==

// @name Kill Head-fi

// @namespace mdu

// @description remove annoying sidebar

// @include http://www.head-fi.org/forums/

// ==/UserScript==

// get rid of annoying top ad banners:

var pagenavMenuId = "pagenav_menu";

try

{

var pageNavMenu = document.getElementById(pagenavMenuId);

var pageNavMenuParent = pageNavMenu.parentNode;

var foundPageNavMenu = false;

var numTargetElements = 2; // get rid of the first 2 tables after the pageNavMenu element

var targetElements = [];

for (var i=0; i < pageNavMenuParent.childNodes.length; i++)

{

var thisElement = pageNavMenuParent.childNodes[ i ];

if (!foundPageNavMenu && thisElement.id == pagenavMenuId)

{

foundPageNavMenu = true;

}

else if (foundPageNavMenu && thisElement.tagName && thisElement.tagName.toLowerCase() == "table")

{

targetElements.push(thisElement);

if (targetElements.length == numTargetElements)

{

break;

}

}

}

for (var i=0; i < targetElements.length; i++)

{

pageNavMenuParent.removeChild(targetElements[ i ]);

}

}

catch (ignore)

{;}

// get rid of annoying sidebar:

var tds = document.getElementsByTagName('td');

for (var i in tds)

{

var td = tds[ i ];

if (td && td.width == "1%" && td.style.paddingLeft == "10px")

{

td.parentNode.removeChild(td);

}

}

Guest username
Posted

Thanks for witting that mulveling, it works well and I got it to work for everything I clicked on.

Also thanks for the program dc; i'll look into it some more for other sites I don't like the way they look :)

and @aardvark sandwich

I don't think you understood which sidebar I was talking about. See my seconded post for clarification if you care any.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.