script is broken
|
|
I love this script, but unfortunately it is now broken due to a facebook update. would love to have this back up and running. one of the best facebook scripts out there. |
|
|
They just changed a couple of element class names: // ==UserScript== // @name Facebook Highlights Remove // @namespace http://tech.karbassi.com // @homepage http://tech.karbassi.com // @author Ali Karbassi // @description Removes the annoying hightlights part of the new facebook design. Works in Firefox and Safari. // @include http://*.facebook.com/* // ==/UserScript== // Comment out the header you don't want removed. var toRemove = [ //"Today", //"Tomorrow", "Suggestions", "Highlights", "People you might know", "Connect with friends" ]; // Do not touch if you have no clue what you're doing :D // This function is from Dustin Diaz function getElementsByClass(searchClass,node,tag) { var classElements = new Array(); if ( node == null ) node = document; if ( tag == null ) tag = '*'; var els = node.getElementsByTagName(tag); var elsLen = els.length; var pattern = new RegExp('(^|\\\\s)'+searchClass+'(\\\\s|$)'); for (i = 0, j = 0; i < elsLen; i++) { if ( pattern.test(els[i].className) ) { classElements[j] = els[i]; j++; } } return classElements; } Array.prototype.inArray = function (value) { for (var i=0; i < this.length; i++) { if (this[i] === value) { return true; } } return false; }; var el = getElementsByClass('UITitledBox_Title'); for( var i = 0; i < el.length; i++ ) { var temp = el[i]; if (toRemove.inArray(temp.innerHTML)) { // Let's fine the top level div that holds all of the content while ((temp.className != 'UIHomeBox UITitledBox') && (temp.className.indexOf('UIHomeBox UITitledBox') <= 0)){ temp = temp.parentNode; } // Remove this box var t = temp; t.parentNode.removeChild(t); } } // Nothing is left, let's remove the sidebar and expand. el = document.getElementById('home_sidebar'); if (el.childNodes.length == 0) { // Remove the sidebar el = document.getElementById('home_sidebar'); el.parentNode.removeChild(el); // Expand the main content document.getElementById('home_left_column').style.width = '940px'; document.getElementById('home_stream').style.width = '800px';
// Expand the individual messages now. Woot! el = getElementsByClass('UIIntentionalStory_Message'); for (i = el.length - 1; i >= 0; i--){ el[i].style.width = "730px"; }; } |
|
|
Updated the code. Should work. If it doesn't I will try to watch this topic more often and fix the code. |
|
|
I have noticed an interesting little thing with the script. I have changed the user portion of the script such that I can still access "Events" and "Friend Suggestions". If I click on "See All" for either "Events" or "Friends" and then back on "Home", the sections containing "Highlights" and "Sponsored Links" return. It also occurs if I select an application that is bookmarked, or if I select an item from the top-menu bar and then click Home. However, it appears to work fine when an non-bookmarked application is used and the "Home" button on the top-menu is clicked. Sadly, I am too inexperienced with JavaScript to have a rootle through the script and to offer suggestions but I thought I'd bring it to your attention. Would be interested to know how this comes about. I should say that I am using the script on Firefox v3.0.10. |
|
|
Further to my previous note, I think I can gather partly what it is. The problem is that when the main Facebook page is reloaded (after using a Facebook application) rather than having (http://www.facebook.com/home.php?) one ends up with something more like (http://www.facebook.com/home.php?ref=home#/home...) and I think that the Greasemonkey cannot handle web addresses which have # in the URL. So I suppose the question is how should the "included pages" section be modified such that it works on all reloads? |
![]() ![]() |
Recent changes to Facebook's markup mean another update is needed. Change this:
To this:
|

