Extra caution is recommended when installing recently uploaded/updated scripts (read more)
Be sure you trust any scripts you install

Remove Facebook Ads

Previously named Cipher's Facebook Remove Ads

Updated to accommodate changes in Facebook.

Donate To My Caffeine Fund

I'm a college student so that equates to not having much time or money. However, you can donate money to me which I promise to use towards caffeinated items. Caffeine keeps me awake at night which in turn gives me a lot of free time to set at my computer writing userscripts. So basically Your Money -> Caffeine -> Me Awake -> More Userscripts!!!!

Make A Donation With PayPal





1 point
login to vote
chezzo user
Posted Aug 28, 2008

hi, is this going to be updated for the "new" facebook? (new.facebook.com)
at the moment it removes ads but then shifts profiles to the right

1 point
login to vote
Posted Jun 25, 2008

Thanks man, I love it!

1 point
login to vote
sizzlemctwizzle script's author
Posted Jan 7, 2008

I meant new to xpath, not "knew". I need to stop being an idiot.

1 point
login to vote
sizzlemctwizzle script's author
Posted Jan 7, 2008

okay, I think I fixed it. sorry for the screw up. I'm also knew to xpath.

1 point
login to vote
nuprin user
Posted Jan 7, 2008

Hi,

I'm new to xpath, but I think there's a bug in the conditional expression for picking the DOM nodes that are ads. Here's a suggested modification:

      
      function remove(element) {
        element.parentNode.removeChild(element);
      }
      
      var xpathExpression = 
      	'//div[contains(@class, "ad_") or contains(@class, "_ad")]';
      
      var ads = document.evaluate(xpathExpression, document.body, null, 
      	XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
      
      for (var i = 0, ad; ad = ads.snapshotItem(i); i++) {
      	remove(ad);
      }
      
      if (document.getElementById('ssponsor')) {
      	remove(document.getElementById('ssponsor'));
      }
      

You could comment on this script if you were logged in.