Skip to content


A few ad-killing Greasemonkey scripts

It always takes me “too much” time to find my Greasemonkey scripts on userscripts (notably because I tend to always forget my password and because the site is quite slow), and not many people download them anyway. So I figured I’d post them here instead. I’m sorting this post in the “Firefox” category, although I’ve just discovered that, according to Wikipedia, those might very well run in Chrome (it will be treated like an extension) and Opera (short guide here).

Update (2012-03-30): quite pissed at Yahoo right now because their stupid bot blocked me from sending e-mails at the moment… So I updated the script to block all ads (including the small ad on the mail search page), and uploaded it to userscripts to give it a bit more exposure. MIT license: adapt and share!

Yahoo! Mail ad cleaner

Most of the ads in my Yahoo! Mail are already blocked by Ad Block (or maybe by my use of HTTPS via the HTTPS Everywhere extension?), but they leave huge blank spaces. This script will let you reclaim those spaces. Note that there is (as far as I known) just one exception: the script doesn’t remove the ad that may appear when you do a search through your e-mail. I find those ads usually quite relevant and fairly discrete (just one line), so I don’t suppress them (and actually I tend visit them somewhat often).
Here’s the script: Yahoo_Mail_Ad_Cleaner.user.js. If you have Greasemonkey installed already, it should let you install it as well as preview it.

Generation-NT ad cleaner

Generation-NT is a tech news website, mostly in French but they do have a US version (which doesn’t seem to have the same ads, though, so you probably don’t need this script for the US version).
Same concept as Yahoo! Mail ad cleaner: reclaim the space left empty by Ad Block. If you happen to read the source, you’ll find that I left a few commented sections because I tried several ways to iterate over the div and remove (hide) them by class. And I prefer to keep them for later use in case the current version became inefficient for some reason.
Here’s the script: GNT_Ad_Cleaner.user.js.

Note that both those scripts should be able to auto-update, although I don’t think this will happen soon. If you don’t want this, you can turn off scripts auto-updates in Greasemonkey, or you can remove the @updateURL line in the scripts.

Posted in Firefox, Greasemonkey scripts, Internet.


3 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.

  1. Anonymous says

    Could you update Yahoo! Mail ad cleaner for latest changes? Thanks a lot!

  2. patheticcockroach says

    I’ll have a look at it next month when I have more time. Not sure it will work fine though, currently blocking ads with AdBlock Edge + Ghostery, this leaves a HUGE (as in, half the 1920×1080 screen) empty space…

  3. Anonymous says

    for geeks with larger screens, you can also reclaim all the free space left on the right, by adding:

    parent.document.getElementById(“main”).style.maxWidth=”none”;
    parent.document.getElementById(“shellcontent”).style.right=”0px”;



Some HTML is OK

or, reply to this post via trackback.

Sorry about the CAPTCHA that requires JS. If you really don't want to enable JS and still want to comment, you can send me your comment via e-mail and I'll post it for you.

Please solve the CAPTCHA below in order to fight spamWordPress CAPTCHA