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;

document.addEventListener(“DOMNodeInserted”,
function(evt) {
if (evt.target.className == “T1HY1 XoqCub MMcQxe”) {
var column = document.evaluate(“.//td[@class=’tELAdc’ and position()=3]”, evt.target, null, XPathResult.ANY_UNORDERED_NODE_TYPE, null).singleNodeValue;
if (column) {
var subjectline = document.evaluate(“.//h1[@class=’YfMhcb’]”, evt.target, null, XPathResult.ANY_UNORDERED_NODE_TYPE, null).singleNodeValue;
var linksdiv = document.evaluate(“.//div[@class=’yMuNaf’]”, evt.target, null, XPathResult.ANY_UNORDERED_NODE_TYPE, null).singleNodeValue;
subjectline.parentNode.insertBefore(linksdiv, subjectline);
column.parentNode.removeChild(column);
column = document.evaluate(“.//td[@class=’tELAdc’ and position()=2]”, evt.target, null, XPathResult.ANY_UNORDERED_NODE_TYPE, null).singleNodeValue;
column.parentNode.removeChild(column);
}
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];
}
}
}
widerGmailMessageViewTargetCSSRule.style.cssText = “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.

Advertisements

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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: