Jump to content

Use greasemonkey to remove head-fi sidebar?


Guest username

Recommended Posts

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.

Link to comment
Share on other sites

Guest username

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.

Link to comment
Share on other sites

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);

}

}

Link to comment
Share on other sites

Guest username

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

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