Google Inbox Count Display

By Jon Ramsey Last update May 29, 2006 — Installed 2,428 times. Daily Installs: 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 2, 0
// Google Inbox Count Display

// $Id: google.cache.user.js 33 2005-12-29 16:54:00Z jon $
// Copyright (C) 2005 by Jonathon Ramsey (jonathon.ramsey@gmail.com)

// This file is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published
// by the Free Software Foundation; either version 2, or (at your
// option) any later version.

// This file is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with this software; see the file COPYING. If not, write to
// the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
// Boston, MA 02111-1307, USA.

// ==UserScript==
// @name           Google Inbox Count Display
// @namespace      htt://babylon.idlevice.co.uk/javascript/greasemonkey/
// @description    Modify Gmail inbox title to display count of unread messages at the beginning, so unread count displays in a small tab
// @include        http://mail.google.com/*
// @include        https://mail.google.com/*
// ==/UserScript==

unsafeWindow.document.watch('title',
  function(prop, oldval, newval) {
     if (matches = newval.match(/Inbox \((\d+)\)/)) {
        newval = matches[1] + ' unread - Google Mail - Inbox';
     }
     return (newval);
  });