Show me the code! – By Davanum Srinivas

February 11, 2010

Hide/Toggle GMail Decorations (esp for Google Buzz) using a bookmarklet

Filed under: Code Snippets — Tags: , , , , — Davanum Srinivas @ 10:57 pm

Create link in your tool bar and cut-n-paste the code below into the link, then you can just click on it when logged into GMail to hide the decorations around the center.

javascript: void((function () {
    function hide(doc, xpath) {
        var items = doc.evaluate(xpath, doc, null, XPathResult.ANY_TYPE, null);
        var item = items.iterateNext(); = ( != 'none' ? 'none' : '');
    var items = document.evaluate('//iframe[5]', document, null, XPathResult.ANY_TYPE, null);
    var frame = items.iterateNext();
    var doc = (frame.contentWindow || frame.contentDocument);
    if (doc.document) doc = doc.document;
    hide(doc, '/html/body/div/div[2]/div/table/tr/td');
    hide(doc, '/html/body/div/div[2]/div/table/tr/td[2]');
    hide(doc, '/html/body/div/div[2]/div/table/tr/td[4]');
    hide(doc, '/html/body/div/div[2]/div/table/tr/td[5]');
    hide(doc, '/html/body/div/div[2]/div/div/div/div[2]');
    hide(doc, '/html/body/div/div[2]/div/div/div/div[3]');
    hide(doc, '/html/body/div/div[2]/div/table/tr/td[3]/div[2]/div[2]');

1 Comment »

  1. hey, how do you display code like this? i mean in a box with line numbers?

    Comment by sureshamrita — September 28, 2010 @ 10:27 pm

RSS feed for comments on this post. TrackBack URI

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 )

Google+ photo

You are commenting using your Google+ 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 )


Connecting to %s

Blog at

%d bloggers like this: