Source for "Yahoo Mail Ad Removal"

By Motty Katan
Has 8 other scripts.


// ==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/ym/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  
GM_addStyle("iframe#emptyFolderFrame{ visibility:hidden; }");
GM_addStyle("div#northbanner { visibility:hidden; }");
GM_addStyle("embed { visibility:hidden;}");

//Thanks to Mug Nebot that commented and said that these lines removes texts ads
  GM_addStyle("div#nwad { display:none;}");
  GM_addStyle("div#swads { display:none;}");

//Yahoo Mail Beta
//if Yahoo Mail Beta
if (unsafeWindow.gExtContent){
  //yep I know the loop will hide the publicit? but I think its better to hide the
  //whole Iframe :) You will have to live with my decision or convice me otherwise.
  GM_addStyle("iframe#welcomePageAds{ visibility:hidden;display:none;}");
  for(sKey in unsafeWindow.gExtContent){
    //use this commented line to hide also yahoo mail tips
    //GM_addStyle("#slot_"+sKey+",div#"+sKey+"_div { visibility:hidden;display:none;}");
    
    //or just hide ads using another line marked as #unique_ad
    GM_addStyle("#slot_"+sKey+"{ visibility:hidden;display:none;}");
  }
  //#unique_ad this line can be removed if using the for loop to hide
  //all ads which includes the yahoo tips for services.
  GM_addStyle("div#H3_div { visibility:hidden;display:none;}");

  //yet another annoying iframe (on the right side at least on yahoo fr)
  GM_addStyle("iframe#largeFrame{visibility:hidden;display:none;}");
   
  //future support - currently does nothing!
  unsafeWindow.kPartner.noAds = true;
  unsafeWindow.kPartner.extAds = false
  unsafeWindow.kPartner.isHeadAdServed = false;
  
  //Cool line of code!
  // does:
  // 1. expands the folder space 
  // 2. expands the area of the messages
  unsafeWindow.kPartner.bucket = 0;
  
  //actually this line seems insignificant
  //but it does no evil, for the moment it stays.
  unsafeWindow.gLaunchProfile.stop("--ads");   

}//end of yahoo mail beta