<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>Discussion on Gmail FavIcon Alerts 3 | Userscripts.org</title>
    <link>http://userscripts.org/scripts/show/24430</link>
    <description>Recent comments on userscript: Gmail FavIcon Alerts 3</description>
    <language>en-us</language>
    <ttl>60</ttl>
    <item>
      <title>Bug: Not counting inbox unread, but a label, replied by leopolly @ Fri, 03 Jul 2009 00:13:43 +0000</title>
      <description>&lt;p&gt;so far, so good...&lt;/p&gt;</description>
      <pubDate>Fri, 03 Jul 2009 00:13:43 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:28701:141617</guid>
      <author>leopolly</author>
      <link>http://userscripts.org/topics/28701</link>
    </item>
    <item>
      <title>Compatability with GMail Compactor, replied by Peter Wooley @ Fri, 26 Jun 2009 05:16:33 +0000</title>
      <description>&lt;p&gt;Support for Gmail Compactor is now back in the script. Go ahead and grab the latest version (3.0.7) and give it a whirl!&lt;/p&gt;</description>
      <pubDate>Fri, 26 Jun 2009 05:16:33 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:25975:138630</guid>
      <author>Peter Wooley</author>
      <link>http://userscripts.org/topics/25975</link>
    </item>
    <item>
      <title>Bug: Not counting inbox unread, but a label, replied by Peter Wooley @ Fri, 26 Jun 2009 05:14:47 +0000</title>
      <description>&lt;p&gt;I believe we solved this problem along with a larger bug &lt;a href=&quot;http://userscripts.org/topics/19266?page=3&quot;&gt;in another thread&lt;/a&gt;, so grab the latest version (3.0.7) and let me know if the problem is fixed!&lt;/p&gt;</description>
      <pubDate>Fri, 26 Jun 2009 05:14:47 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:28701:138628</guid>
      <author>Peter Wooley</author>
      <link>http://userscripts.org/topics/28701</link>
    </item>
    <item>
      <title>Still not fully working, replied by Peter Wooley @ Fri, 26 Jun 2009 02:54:22 +0000</title>
      <description>&lt;p&gt;The script has been updated! I went to Disneyland for the week and could not think of a solution. I got back and &lt;strong&gt;bam&lt;/strong&gt;, the bug was diagnosed and solved! Thanks again for figuring this out.&lt;/p&gt;</description>
      <pubDate>Fri, 26 Jun 2009 02:54:22 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:19266:138570</guid>
      <author>Peter Wooley</author>
      <link>http://userscripts.org/topics/19266</link>
    </item>
    <item>
      <title>Still not fully working, replied by Peter Wooley @ Fri, 26 Jun 2009 02:37:20 +0000</title>
      <description>&lt;p&gt;Holy crap. &lt;code&gt;getSystemLabelsElement&lt;/code&gt; works perfectly. Not only that, it also fixes compatibility with GMail Compactor. I'm going to finalize the script and write up the patch notes. Thanks for taking the time to figure this out, @tschordi, @Moops, and @burnside!&lt;/p&gt;</description>
      <pubDate>Fri, 26 Jun 2009 02:37:20 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:19266:138555</guid>
      <author>Peter Wooley</author>
      <link>http://userscripts.org/topics/19266</link>
    </item>
    <item>
      <title>Still not fully working, replied by Peter Wooley @ Fri, 26 Jun 2009 02:27:53 +0000</title>
      <description>&lt;p&gt;@Moops I gave up on the ID simply because it changed only days after I updated the script, and I've watched it change several times since I started working with the Inbox node.&lt;/p&gt;

&lt;p&gt;@tschordi I guess I can't argue with 1.5 years of consistent behavior. I'm going to play with it a bit more, but I think I may just grab the getSystemLabelsElement, assuming it passes all the tests.&lt;/p&gt;</description>
      <pubDate>Fri, 26 Jun 2009 02:27:53 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:19266:138553</guid>
      <author>Peter Wooley</author>
      <link>http://userscripts.org/topics/19266</link>
    </item>
    <item>
      <title>Still not fully working, replied by tschordi @ Thu, 25 Jun 2009 19:47:36 +0000</title>
      <description>&lt;p&gt;Check out the first comment by mikepurvis from Nov 07, 2007 on the API site:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://code.google.com/p/gmail-greasemonkey/wiki/GmailGreasemonkey10API&quot;&gt;http://code.google.com/p/gmail-greasemonkey/wik...&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&quot;AFAICT, gmail.getSystemLabelsElement returns a reference to the DOM element that encloses the topmost navigation box in the left pane, not the green box of user-created Labels. I may have misunderstood the documentation, but it could be clearer which behaviour it's supposed to be.&quot;&lt;/p&gt;

&lt;p&gt;Seems the behavior of &lt;code&gt;getSystemLabelsElement&lt;/code&gt; is correct.&lt;/p&gt;</description>
      <pubDate>Thu, 25 Jun 2009 19:47:36 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:19266:138349</guid>
      <author>tschordi</author>
      <link>http://userscripts.org/topics/19266</link>
    </item>
    <item>
      <title>Still not fully working, replied by burnside @ Thu, 25 Jun 2009 16:09:14 +0000</title>
      <description>&lt;p&gt;Well, it's working for me finally!  Thanks for working on this script.&lt;/p&gt;</description>
      <pubDate>Thu, 25 Jun 2009 16:09:14 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:19266:138252</guid>
      <author>burnside</author>
      <link>http://userscripts.org/topics/19266</link>
    </item>
    <item>
      <title>Still not fully working, replied by Moops @ Thu, 25 Jun 2009 15:29:30 +0000</title>
      <description>&lt;p&gt;Yeah, I agree, that sounds like an ideal solution.  I wonder why Peter gave up on the ID search technique.  It looks like it changed from :r2 to :r4 recently, but I'm not sure how often google is likely to change it up.&lt;/p&gt;</description>
      <pubDate>Thu, 25 Jun 2009 15:29:30 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:19266:138233</guid>
      <author>Moops</author>
      <link>http://userscripts.org/topics/19266</link>
    </item>
    <item>
      <title>Still not fully working, replied by Peter Wooley @ Thu, 25 Jun 2009 15:26:05 +0000</title>
      <description>&lt;p&gt;Wow, something must be wrong with the getSystemLabelElement(). To be honest, they haven't updated the Greasemonkey API in a long time, so it could easily be pointing the incorrect node. However, as it's a published API, I'd rather use a hacky method than rely on something that shouldn't work.&lt;/p&gt;

&lt;p&gt;For all intensive purposes, I like both of your approaches (the code's much cleaner), but I'm really curious about the getSystemLabelElement and want to play with it a bit this evening before putting it in the code.&lt;/p&gt;

&lt;p&gt;There is some good news, though. I am not sure how, but I replicated the issue on my box at work and the beta code fixed it. So, if nothing else, we should be able to fix the problem with one of these fixes. ;)&lt;/p&gt;</description>
      <pubDate>Thu, 25 Jun 2009 15:26:05 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:19266:138229</guid>
      <author>Peter Wooley</author>
      <link>http://userscripts.org/topics/19266</link>
    </item>
    <item>
      <title>Still not fully working, replied by tschordi @ Thu, 25 Jun 2009 07:42:03 +0000</title>
      <description>&lt;p&gt;Moobs,&lt;/p&gt;

&lt;p&gt;i've analysed the &lt;code&gt;getSystemLabelsElement&lt;/code&gt; method and in my opinion it isn't the method to get the label box. In my tests it returns the system labels (inbox, starred, sent...).&lt;/p&gt;

&lt;p&gt;I have found that in the first poll, the &lt;code&gt;getSystemLabelsElement&lt;/code&gt; returns nothing. In the second poll it returns the correct element. This can be the reason why the first poll didn't work (because the SystemLabels doesn't exist with the first poll).&lt;/p&gt;

&lt;p&gt;Peter, the question is, why don't we use the &lt;code&gt;getSystemLabelsElement&lt;/code&gt; instead of the &lt;code&gt;getNavPaneElement&lt;/code&gt; method?&lt;/p&gt;

&lt;p&gt;My changes to the &lt;code&gt;this.getSearchElement&lt;/code&gt; method from 3.0.6:&lt;/p&gt;

&lt;p&gt;&lt;pre&gt;
this.getSearchElement = function() {
	var element;
	var nav = gmail.getSystemLabelsElement();
	
	if(nav) {
		element = nav.getElementsByTagName('a')[0];	
	}
	
	return element ? element: null;
}
&lt;/pre&gt;&lt;/p&gt;</description>
      <pubDate>Thu, 25 Jun 2009 07:42:03 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:19266:138107</guid>
      <author>tschordi</author>
      <link>http://userscripts.org/topics/19266</link>
    </item>
    <item>
      <title>Still not fully working, replied by tschordi @ Thu, 25 Jun 2009 07:06:34 +0000</title>
      <description>&lt;p&gt;Peter,&lt;/p&gt;

&lt;p&gt;you also have a german user, so the search for the inbox text isn't the best method. ;-)&lt;/p&gt;

&lt;p&gt;The beta script works for me, too.&lt;/p&gt;</description>
      <pubDate>Thu, 25 Jun 2009 07:06:34 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:19266:138099</guid>
      <author>tschordi</author>
      <link>http://userscripts.org/topics/19266</link>
    </item>
    <item>
      <title>Still not fully working, replied by Moops @ Thu, 25 Jun 2009 05:42:59 +0000</title>
      <description>&lt;p&gt;Yes, that works for me.  I was just messing around in the same function myself and I noticed that the search returned the link to my first label as gmail loaded for the first time.  So I put this check in there:&lt;/p&gt;

&lt;p&gt;&lt;pre&gt;if(nav) {
  if (gmail.getNavPaneElement() != gmail.getSystemLabelsElement())
    element = gmail.getNavPaneElement().getElementsByTagName('a')[0];
}&lt;/pre&gt;&lt;/p&gt;

&lt;p&gt;Which also works, but I'm not sure if it's more/less of a hack than your approach.  I tested with the chat box moved above and below the labels with success.  Maybe this gives you an idea anyway.&lt;/p&gt;</description>
      <pubDate>Thu, 25 Jun 2009 05:42:59 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:19266:138070</guid>
      <author>Moops</author>
      <link>http://userscripts.org/topics/19266</link>
    </item>
    <item>
      <title>Still not fully working, replied by Peter Wooley @ Thu, 25 Jun 2009 05:07:40 +0000</title>
      <description>&lt;p&gt;Hey all,
&lt;br /&gt;After peering at the DOM for a bit more, I noticed that one factor hasn't changed: the third parent of the Inbox node is always a &lt;code&gt;span&lt;/code&gt; tag. It's a bit esoteric, but grabbing the correct node is simply the most bizarre part of this script. As you're hacking away at the script, would you mind trying a patch? As I can't duplicate the effect, I don't want to publish the changes just yet. With this change, you should be able to revert your workarounds.&lt;/p&gt;

&lt;p&gt;I've prepared a beta version of the script, hosted locally, that you can install. &lt;strong&gt;This will destroy any changes you've made to your local version&lt;/strong&gt;. You can take a look at the script and install it here: &lt;a href=&quot;http://peterwooley.com/projects/greasemonkey/gmailfaviconalerts/3.0/beta/3.0.7b1.user.js&quot;&gt;http://peterwooley.com/projects/greasemonkey/gm...&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The changes in the script above are from line 261 to 270 (at least, in my script; yours may differ, depending on any changes to the script), which replaces the &lt;code&gt;this.getSearchElement&lt;/code&gt; method with this revised one:&lt;/p&gt;

&lt;p&gt;&lt;pre&gt;this.getSearchElement = function() {
	var potential, element;
	var nav = gmail.getNavPaneElement();
	
	if(nav) {
		potential = gmail.getNavPaneElement().getElementsByTagName('a')[0];
		
		try {
			if(potential.parentNode.parentNode.parentNode.nodeName.search(/span/i) === 0) {
				element = potential;
			}
		} catch(error) {
			// potential is not valid, allow method to return null
		}
	}
	
	return element ? element: null;
}&lt;/pre&gt;&lt;/p&gt;

&lt;p&gt;The additional check (in the try...catch) is looking for the tag's third parent nodeName. If it's a &lt;code&gt;span&lt;/code&gt; tag, we can assume the node we're looking at is the Inbox node. If not, we keep on looking.&lt;/p&gt;

&lt;p&gt;If you try this, please let me know if it works or doesn't!&lt;/p&gt;

&lt;p&gt;Peter&lt;/p&gt;</description>
      <pubDate>Thu, 25 Jun 2009 05:07:40 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:19266:138054</guid>
      <author>Peter Wooley</author>
      <link>http://userscripts.org/topics/19266</link>
    </item>
    <item>
      <title>Still not fully working, replied by Peter Wooley @ Thu, 25 Jun 2009 04:07:07 +0000</title>
      <description>&lt;p&gt;Ahh, that mysterious Gmail DOM. This has been a thorn in the side of every Gmail script. I'm glad you found this workaround, though I'll do some more digging to see if I can validate that the Inbox tag is the Inbox tag. The trouble with matching /Inbox/ is that it breaks internationalization. As I know we have at least one French user, I'll do my best to keep it.&lt;/p&gt;</description>
      <pubDate>Thu, 25 Jun 2009 04:07:07 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:19266:138035</guid>
      <author>Peter Wooley</author>
      <link>http://userscripts.org/topics/19266</link>
    </item>
    <item>
      <title>Still not fully working, replied by Moops @ Thu, 25 Jun 2009 00:42:49 +0000</title>
      <description>&lt;p&gt;tschordi, thanks!  That worked for me as well, but I changed it slightly.&lt;/p&gt;

&lt;p&gt;&lt;pre&gt;if(!self.searchElement) {
  self.searchElement = self.getSearchElement();
  if (!self.searchElement.textContent.match(/Inbox/)) {
    self.searchElement = null;
  }
}
&lt;/pre&gt;&lt;/p&gt;

&lt;p&gt;That way it will search each poll only until it successfully finds the Inbox and no more.&lt;/p&gt;</description>
      <pubDate>Thu, 25 Jun 2009 00:42:49 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:19266:137946</guid>
      <author>Moops</author>
      <link>http://userscripts.org/topics/19266</link>
    </item>
    <item>
      <title>Still not fully working, replied by tschordi @ Wed, 24 Jun 2009 11:07:31 +0000</title>
      <description>&lt;p&gt;Version 3.0.6:&lt;/p&gt;

&lt;p&gt;I changed&lt;/p&gt;

&lt;p&gt;Line 282-283
&lt;br /&gt;&lt;code&gt;
&lt;br /&gt;if(!self.searchElement)
&lt;br /&gt;  return self.searchElement = self.getSearchElement();
&lt;br /&gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;to&lt;/p&gt;

&lt;p&gt;&lt;code&gt;
&lt;br /&gt;if(!self.searchElement)
&lt;br /&gt;  return self.searchElement = self.getSearchElement();
&lt;br /&gt;else
&lt;br /&gt;  self.searchElement = self.getSearchElement();
&lt;br /&gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This searches for the inbox link on every poll. Works for me.&lt;/p&gt;</description>
      <pubDate>Wed, 24 Jun 2009 11:07:31 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:19266:137590</guid>
      <author>tschordi</author>
      <link>http://userscripts.org/topics/19266</link>
    </item>
    <item>
      <title>Still not fully working, replied by burnside @ Tue, 23 Jun 2009 02:46:14 +0000</title>
      <description>&lt;p&gt;Nice investigating tschordi.  Could you share the 2.6 script with us.  I only care about the inbox unread text anyways.&lt;/p&gt;</description>
      <pubDate>Tue, 23 Jun 2009 02:46:14 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:19266:137019</guid>
      <author>burnside</author>
      <link>http://userscripts.org/topics/19266</link>
    </item>
    <item>
      <title>Still not fully working, replied by tschordi @ Sun, 21 Jun 2009 09:18:34 +0000</title>
      <description>&lt;p&gt;The difference was the favicon script version. 2.6 works because the search method for the unread count was based on the inbox text. Version 3.0 uses the getNavPaneElement from the GMail Greasemonkey API. The first link under this element should be the inbox link.&lt;/p&gt;

&lt;p&gt;I debugged the search method in 3.0 and it doesn't return the inbox link. It returns the first link from my quick links box.&lt;/p&gt;

&lt;p&gt;Mysterious...&lt;/p&gt;

&lt;p&gt;It could be that the navigation links aren't the first elements at the time when the poll event is fired first.&lt;/p&gt;</description>
      <pubDate>Sun, 21 Jun 2009 09:18:34 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:19266:136256</guid>
      <author>tschordi</author>
      <link>http://userscripts.org/topics/19266</link>
    </item>
    <item>
      <title>Still not fully working, replied by tschordi @ Sat, 20 Jun 2009 15:14:11 +0000</title>
      <description>&lt;p&gt;Regularly I use 3 different PCs. I have all updated to Firefox 3.0.11 recently. One installation works! I try to search for the difference between these three installations/profiles.&lt;/p&gt;</description>
      <pubDate>Sat, 20 Jun 2009 15:14:11 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:19266:135964</guid>
      <author>tschordi</author>
      <link>http://userscripts.org/topics/19266</link>
    </item>
    <item>
      <title>Still not fully working, replied by burnside @ Fri, 19 Jun 2009 18:33:36 +0000</title>
      <description>&lt;p&gt;That is strange why Google Reader is fine but not GMail.  :(&lt;/p&gt;</description>
      <pubDate>Fri, 19 Jun 2009 18:33:36 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:19266:135555</guid>
      <author>burnside</author>
      <link>http://userscripts.org/topics/19266</link>
    </item>
    <item>
      <title>Still not fully working, replied by Moops @ Wed, 17 Jun 2009 22:35:59 +0000</title>
      <description>&lt;p&gt;I see the red icon all the time with 0/1/many new mails.  Refreshing the page has no effect either.  The only thing that changed on my end was the FF update.  I have since updated this script though.  The GReader script is working great still.&lt;/p&gt;</description>
      <pubDate>Wed, 17 Jun 2009 22:35:59 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:19266:134739</guid>
      <author>Moops</author>
      <link>http://userscripts.org/topics/19266</link>
    </item>
    <item>
      <title>Still not fully working, replied by tschordi @ Wed, 17 Jun 2009 17:41:38 +0000</title>
      <description>&lt;p&gt;I've inserted the source code of the favicon script in a script tag in the head. right click --&gt; edit html...
&lt;br /&gt;Then I execute following code at the firebug command line:
&lt;br /&gt;&lt;code&gt;
&lt;br /&gt;gmonkey.load('1.0', function(gmail) {
&lt;br /&gt;			gfia(gmail);
&lt;br /&gt;		});
&lt;br /&gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;It works for me.&lt;/p&gt;

&lt;p&gt;I deactivated all addons except firebug and greasemonkey. Still no luck... It must be related to the Firefox 3.0.11 update.&lt;/p&gt;</description>
      <pubDate>Wed, 17 Jun 2009 17:41:38 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:19266:134586</guid>
      <author>tschordi</author>
      <link>http://userscripts.org/topics/19266</link>
    </item>
    <item>
      <title>Still not fully working, replied by Peter Wooley @ Wed, 17 Jun 2009 07:08:09 +0000</title>
      <description>&lt;p&gt;I've now tested on an account with every lab feature enabled (save for Hide Unread Count) and set to different languages with no luck in replicating the behavior.&lt;/p&gt;

&lt;p&gt;Besides me, is there anyone out there experiencing the bug only some of the time? For those without any functionality, is there anything besides the Firefox 3.0.11 update that changed in your environment?&lt;/p&gt;

&lt;p&gt;@tschordi I'm curious, how did you go about loading the script through Firebug?&lt;/p&gt;</description>
      <pubDate>Wed, 17 Jun 2009 07:08:09 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:19266:134353</guid>
      <author>Peter Wooley</author>
      <link>http://userscripts.org/topics/19266</link>
    </item>
    <item>
      <title>Still not fully working, replied by tschordi @ Tue, 16 Jun 2009 19:03:23 +0000</title>
      <description>&lt;p&gt;It doesn't appear that this is an issue due to DOM changes. I have inserted the FavIcon script in the DOM through Firebug and it works! I use script version 3.0.6. I have recently updated because i expected this solved the issue.&lt;/p&gt;</description>
      <pubDate>Tue, 16 Jun 2009 19:03:23 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:19266:134088</guid>
      <author>tschordi</author>
      <link>http://userscripts.org/topics/19266</link>
    </item>
  </channel>
</rss>
