GVoice Favicon Alerts

By Peter Wooley Last update May 7, 2012 — Installed 24,745 times.

Script broken with latest GVoice update?

in
Subscribe to Script broken with latest GVoice update? 9 posts, 4 voices



kuemerle5 User
Firefox

Oh noes! It looks like the most recent Gvoice gui rollout has broken this script. Any chance of making it work again? Thank you so much!

 
irishtexmex User
Firefox

I, too, am having problems since the new UI update. Love the new GUI, but I need the favicon working more.

Thanks for the script!

 
Ben999_ User
Chrome

I've come up with a fix. I'm sure it's not the best way to do it but it works. Replace the getSearchText method with the one below. I pulled the sidebar container object and did a conversion to text by concatenating with a null string. This gave all the text content including the unread count! Just pulled out what was needed for up to 9999 messages. Done

this.getSearchText = function() {
var text = "";
if(document.getElementById("gc-sidebar-jfk-container"))
{
elem = document.getElementById("gc-sidebar-jfk-container");
text = elem.firstChild.textContent + "";
subtext = text.substring(14,19);
}
//alert(subtext);
return subtext;
}

 
kuemerle5 User
Firefox

After half an hour, I cam up with the idea that you could replace (around line 224):

text = top.document.getElementById('gc-inbox-sidebar-menu').firstChild.textContent;

with the following:
text = top.document.getElementsByClassName('goog-menuitem gcSidebarItem selectedItem hasCount')[0].lastChild.textContent;

which get the unread count back but I am running into an issue that after an item is marked as read, the unread count in the favicon doesn't update. I'll continue debugging this in Chrome and see if I can get it to update after a change.

 
kuemerle5 User
Firefox

HAHA. GOT IT! Apparently, the div classes change when you select, when there's an unread item, etc, so I had to change the getElementsByClassName() to look for "msgCount goog-menuitem-content goog-inline-block" instead. Since there are 12 matches in the DOM, I just picked the first one, which in the main inbox unread count. I got the text content and bam, it fully works again. Tested in FF8 with Greasemonkey nightly (9/29/2011) and in Chrome 16 (dev?) with just native userscript support. My fix is pretty basic though, so I would have been surprised if it was broken in Chrome or FF. Enough talk though, here's the fix:

Replace lines 223-225 (the conditional inside the getSearchText function with the following:

if(document.getElementsByClassName('msgCount goog-menuitem-content goog-inline-block')) {
text = top.document.getElementsByClassName('msgCount goog-menuitem-content goog-inline-block')[0].textContent;
}

Enjoy! I'll try and message Peter Wooley and see if he'll update the script with this change.

 
Ben999_ User
Firefox

Nice. I was just playing around in firebug, which is new to me. I don't have any kind of debug tools setup so I tried the 'msgCount goog-menuitem-content goog-inline-block' object but didn't realize it was an array. I think what I did just grabbed the text from all the child objects and concatenated them. Probably used a little bit more computation but it worked.

 
irishtexmex User
Firefox

Any update? I am completely tech illiterate and have no idea how to do these manual fixes. :(

 
kuemerle5 User
Firefox

I've tried sending Peter a message on the Userscripts website and his blog but he seems pretty unresponsive so I've just gone ahead and made a copy of his script with the appropriate changes. You can find the new one here: http://userscripts.org/scripts/show/114981. The one I posted *should* update the old one. Good luck!

 
Peter Wooley Script's Author
Firefox

Sorry about that. I've updated the script for anyone that still needs it.

Thanks for finding and publishing the fix.

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