Show me the code! – By Davanum Srinivas

November 9, 2007

Greasemonkey script for hiding Ads in GMail (v2)

Filed under: Uncategorized — Davanum Srinivas @ 3:16 pm

obligatory greasemonkey script for hiding ads when viewing conversations.

Install GMail – Hide Ads Script

// ==UserScript==
// @name          GMail - Hide Ads
// @namespace     https://davanum.wordpress.com/
// @include       http://mail.google.com/*
// @include       https://mail.google.com/*
//by Davanum Srinivas (https://davanum.wordpress.com/)
// ==/UserScript==

window.addEventListener('load', function() {
    if (unsafeWindow.gmonkey) {
        unsafeWindow.gmonkey.load('1.0', function(gmail) {
            function setViewType() {
                if (gmail.getActiveViewType() == 'cv') {
                    var rhs = gmail.getConvRhsElement();
                    if (rhs != null) {
                        rhs.lastChild.style.display = "none";
                    }
                }
            }
            gmail.registerViewChangeCallback(setViewType);
        });
    }
}, true);

2 Comments »

  1. works! great! Also can we maximize the reading view to 100% after we hide the ads?

    Thanks

    Comment by CS — November 19, 2007 @ 9:22 pm

  2. FYI, the script does not work again, perhaps gmail, has hard coded it., to keep ads

    Comment by Rock — June 16, 2008 @ 12:08 am


RSS feed for comments on this post. TrackBack URI

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

Blog at WordPress.com.

%d bloggers like this: