Thursday, September 13, 2007

Annoying gmail advertisements & links

Gmail has been part of my life in the past few years, I recently found its sponsored links particular annoying. Sure most gmail users got the same thought, well some might think it is helpful...but I don't! I decided to remove, there is no default options in gmail allows you to disable it. Examining its generated html code, the entire ad is in the rh section within a big div, so you can force your browser to remove it with greasemonkey or stylish in firefox...
GMAIL code:


// Gmail ad Removal user script
// 2007-09-13
// ==UserScript==
// @name gmail ad removal
// @namespace
// @description remove gmail ad
// @include*
// ==/UserScript==
for (var i=0; i< document.getElementsByTagName("div").length; i++) {
if (document.getElementsByTagName("div").item(i).className == "rh"){
document.getElementsByTagName("div").item(i).style.visibility = "hidden";
document.getElementsByTagName("div").item(i).style.display = "none";

Or in a much cleaner way with css within stylish

@-moz-document domain( {

.rh {display: none !important;}

Using greasemonkey user script is undoubtedly much slower, since it has to loop through all divs... maybe there is a better way to locate div tag class name, but I don't know...anyway, it does the job, who


Anonymous said...

how time fly.

happy new year.

did you still remember me ?

who am i ?

insistkool said...

Happy new year! I have no clue who you are, anonymous. Shoot me an email if you want....

Term Papers said...

I have been visiting various blogs for my term papers writing research. I have found your blog to be quite useful. Keep updating your blog with valuable information... Regards