The Soft Geek

Get Annoyed by ads while seeing mails in Gmail, here is the solution!

Posted on: February 27, 2009

Hey guys!

I recently came across a user script which removes the annoying ad features in Gmail.
On the other hand, it makes your message view wider.

Its a javascript. So you need a javascript enabled browser (i recommend firefox).

Here are the steps:

1. Get Firefox, if you don’t have from here.
2. Install Greasemonkey add-on from here.
3. Go here to install the script.
4. Open your inbox and enjoy the clear view (without ads).

Below is the script, if you want it.
var widerGmailMessageViewTargetCSSRule;

function(evt) {
if ( == “T1HY1 XoqCub MMcQxe”) {
var column = document.evaluate(“.//td[@class=’tELAdc’ and position()=3]”,, null, XPathResult.ANY_UNORDERED_NODE_TYPE, null).singleNodeValue;
if (column) {
var subjectline = document.evaluate(“.//h1[@class=’YfMhcb’]”,, null, XPathResult.ANY_UNORDERED_NODE_TYPE, null).singleNodeValue;
var linksdiv = document.evaluate(“.//div[@class=’yMuNaf’]”,, null, XPathResult.ANY_UNORDERED_NODE_TYPE, null).singleNodeValue;
subjectline.parentNode.insertBefore(linksdiv, subjectline);
column = document.evaluate(“.//td[@class=’tELAdc’ and position()=2]”,, null, XPathResult.ANY_UNORDERED_NODE_TYPE, null).singleNodeValue;
for (var i = 0; i < document.styleSheets.length && !widerGmailMessageViewTargetCSSRule; i++) {
for (var j = 0; j < document.styleSheets[i].cssRules.length && !widerGmailMessageViewTargetCSSRule; j++) {
if (document.styleSheets[i].cssRules[j].selectorText == “.OZly4d”) {
widerGmailMessageViewTargetCSSRule = document.styleSheets[i].cssRules[j];
} = “padding-top: 0; float: right; padding-right: 1ex;”
}, false);


Note: Listen non-firefox users (or users with no user script manager add-ons available)-You may not be able to hide the ads, and if you manage to, please let me know how.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: