Gmail Unread Message Count in Favicon

By Eric Bogs Last update Nov 25, 2009 — Installed 23,092 times. Daily Installs: 27, 26, 31, 19, 24, 14, 15, 49, 57, 48, 28, 34, 26, 16, 15, 16, 11, 20, 21, 19, 16, 17, 24, 37, 21, 16, 18, 20, 15, 25, 10, 13

Script not working?

Subscribe to Script not working? 11 posts, 5 voices

Matt Clark User
FirefoxWindows

I'm on Win 7 and FF 3.5.5 and the script doesn't seem to be working. I'm using it via Better Gmail 2 which has a problem report here: http://groups.google.com/group/better-gmail-2-f...

Any help is appreciated.

Thanks!
Matt

 
Peter Wooley Scriptwright
FirefoxWindows

Hey Eric,
I'm not sure I can completely trust this, but my current workaround is switching my call to getNavPaneElement() on the Gmail API to:

var nav = top.document.getElementById('canvas_frame').contentWindow.document.getElementById(':in');

I know trusting the ':in' id is a bit dangerous, but without that hook, I'm not sure what else we can do.

If you find a safer way, let me know!

Peter

 
Peter Wooley Scriptwright
FirefoxWindows

Wow, feel free to scratch that. :-p Had to go another way and access based on the class that's been stable for the last few months:

var frame = top.document.getElementById('canvas_frame')
if(frame) {
var nav = frame.contentWindow.document.getElementsByClassName('n0');
}

 
Eric Bogs Script's Author
SafariMacintosh

Something along those lines seems to be working, thanks for the lead! :)

 
Levi Wallach Scriptwright
FirefoxWindows

Eric, I am now using your most recent version (1.04) but still not seeing any count, just the red M gmail favicon. I'm running FF 3.5.5 on Windows Vista...

 
Drug0y User
FirefoxWindows

xp sp3 ff 3.5.5: not working for me

 
Levi Wallach Scriptwright
FirefoxWindows

It's odd, my laptop at work this works fine with - even with 1.02. Running the same version of FF. The only difference is Windows Vista Business vs Home Premium...

 
Peter Wooley Scriptwright
FirefoxWindows

Hey Eric. Gmail changed its IDs again.

I've been using the 'n0' class to reference the Inbox node for a while now and it appears to be holding steady. I have no idea when they'll refresh it, but in the mean time, I think you can change line 39 from:

this.inboxSpan_ = frame.contentWindow.document.getElementById(':r3').getElementsByTagName('a')[0];

to:

this.inboxSpan_ = frame.contentWindow.document.getElementsByClassName('n0')[0];

And the script will be back up and running. Here's to hoping Gmail can settle on their DOM for, at least, a little while.

 
Eric Bogs Script's Author
FirefoxMacintosh

Hi all,

I've just uploaded a new version (1.0.5) which fixes the unread count again.

Thanks to Peter for bringing this to my attention!

-Eric

 
Levi Wallach Scriptwright
FirefoxWindows

Still not working for me. All I see is the red M. I'm using Google Apps hosted domain, FF 3.5.5, Faviconize. It was working fine a week ago or so, and I haven't done anything, so I'm assuming it's the Google DOM issue, but I don't even see a zero...

 
Levi Wallach Scriptwright
FirefoxWindows

I finally found the issue for me - it was another Greasemonkey script that was apparently conflicting - GMail - GTD Tickler. Disabling that made your work fine. Go figure!

Cross
Presentational HTML allowed.
Use <code> for inline code and <pre> for code blocks. Use &lt; and &gt; for literal < and >.
We help break paragraphs and link your links.
or cancel