2009-08-16

Disabling ads in Gmail

For those that do not know, Firefox supports the ability for a user to define their own custom CSS settings, allow the user to customize how pages appear in FF. The file is called userContent.css and is located under the chrome/ directory of your profile.

As an exercise, I tried to see if it is possible to suppress the Google ads displayed in the Gmail web interface. Well, with a little help from Firebug to examine the HTML/CSS structure of Gmail pages, I came up with the following:

.vb {
display: none;
}
.u5 {
display: none;
}
table[class~="Bs"] > tr > td:nth-of-type(+3) > div:nth-of-type(+2) {
width: auto !important;
}
table[class~="Bs"] > tr > td:nth-of-type(+3) > div:nth-of-type(+2) >
div > div:last-child
{
display: none;
}

The above works best in FF 3.5, especially since the last items utilize CSS3 selectors.

FF supports the ability to limit the settings for a given domain. I Include the above in the following block so it only applies to google.com sites:

@-moz-document domain(google.com) {
...
}

No comments:

Post a Comment