Yahoo Mail Ad Removal

By Motty Katan Last update Oct 18, 2009 — Installed 17,539 times. Daily Installs: 46, 33, 32, 35, 34, 37, 31, 29, 32, 27, 39, 24, 41, 30, 24, 36, 38, 26, 31, 36, 27, 30, 36, 32, 24, 28, 28, 38, 33, 24, 23, 23

There are 2 previous versions of this script.

// ==UserScript==
// @name          Yahoo Mail Ad Removal
// @namespace     http://moppy.4free.co.il
// @description	  removes the ads Motty Katan(c) Beta is Supported too. 06-02-2006 last updated 16-09-2007 
// @include       http://*.mail.yahoo.com/mc/welcome?*
// @include       http://*.mail.yahoo.com/ym/login*
// @include       http://*.mail.yahoo.com/ym/ShowFolder*
// @include       http://*.mail.yahoo.com/ym/ShowLetter*
// @include       http://*.mail.yahoo.com/ym/Compose*
// @include       http://*.mail.yahoo.com/dc/launch*
// @include       http://*.mail.yahoo.com/ym/Folders*
// ==/UserScript==
//Change Log:
//10/02/06: removed duplicate include url.
//24/02/06 did I remove soething I shouldn't? or yahoo added more ads?
//anyhow added showLetter url to the include.
//17/03/06 BugFixed: attachments were hidden as well.
//26/03/06 iframe are now hidden by this script. changed "us.f516" to *
//         in the include urls just in case
//27/03/06 corrected the login url.(after session expired-relogin the url was without a questionmark)
//31/03/06 added compose url
//15/04/06 added url of Yahoo Mail Beta + removed iframe=hidden since it's deprecated
//27/04/06 added url for folders
//15/09/07 removed ugly code that was very noturious in making html emails and more disappear(Yahoo Clasic)
//         Yahoo Mail Beta support is now really supported all ads are removed.
//16/09/07 Yahoo Mail Beta added another iframe containing ads to hide.
//21/09/07 Yahoo Mail Beta expand both folder space and messages space automaticly  
//18/09/09 Yahoo Mail Beta all is well, just the condition that I've used to detect the beta version 
//         stopped working. I'm sorry. better condition. Yahoo mail classic doesn't work (code part A)
//18/10/09 removed Yahoo mail classic old code till further research. That fixed the reported problem with the attach button. Thanks for all the comments.

//Yahoo Mail Beta
//if Yahoo Mail Beta
if (unsafeWindow.kPartner){

  //Cool line of code!
  // does:
  // 1. expands the folder space 
  // 2. expands the area of the messages
  unsafeWindow.kPartner.bucket = 0;


  if (unsafeWindow.kPartner.wadp)
  {
  //currently 09-2009 there is only one ads (iframe-LREC)
  //better as a loop - to cut on updates
    for(i=0;i<unsafeWindow.kPartner.wadp.length;i++){  
      if (unsafeWindow.kPartner.wadp[i]!==""){
        GM_addStyle("#slot_"+unsafeWindow.kPartner.wadp[i]+"{ visibility:hidden;display:none; }");
      }
    }
  }
  
  //future support - currently does nothing!
  unsafeWindow.kPartner.noAds = true;
  unsafeWindow.kPartner.extAds = false
  unsafeWindow.kPartner.isHeadAdServed = false;
 
  
  //actually this line seems insignificant
  //but it does no evil, for the moment it stays.
  unsafeWindow.gLaunchProfile.stop("--ads");   

}//end of yahoo mail beta