<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>mindtrove &#187; outfox</title>
	<atom:link href="http://mindtrove.info/tag/outfox/feed/" rel="self" type="application/rss+xml" />
	<link>http://mindtrove.info</link>
	<description>Collecting ideas since 1980</description>
	<lastBuildDate>Thu, 01 Jul 2010 01:58:05 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Outfox in Greasemonkey revisited</title>
		<link>http://mindtrove.info/outfox-in-greasemonkey-revisited/</link>
		<comments>http://mindtrove.info/outfox-in-greasemonkey-revisited/#comments</comments>
		<pubDate>Thu, 25 Jun 2009 02:39:30 +0000</pubDate>
		<dc:creator>Peter Parente</dc:creator>
				<category><![CDATA[Accessibility]]></category>
		<category><![CDATA[Ideas]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[greasemonkey]]></category>
		<category><![CDATA[outfox]]></category>
		<category><![CDATA[speech]]></category>

		<guid isPermaLink="false">http://mindtrove.info/?p=219</guid>
		<description><![CDATA[There was some traffic in the Outfox group about my GMail announcer userscript failing in Outfox 0.3.x. The Outfox API has improved quite a bit since 0.1.0, so it's no surprise my script no longer works. Here's a new example script that does work with the latest Outfox 0.3.5 release. Instead of polluting the example [...]]]></description>
			<content:encoded><![CDATA[<p>There was some <a href="http://groups.google.com/group/outfox-discuss/browse_thread/thread/67c53a86a8814a2a">traffic in the Outfox group</a> about my <a href="http://mindtrove.info/outfoxing-gmail-with-greasemonkey/">GMail announcer userscript</a> failing in Outfox 0.3.x. The Outfox API has improved quite a bit since 0.1.0, so it's no surprise my script no longer works.</p>
<p>Here's a new example script that <em>does</em> work with the latest Outfox 0.3.5 release. Instead of polluting the example with all the complications of navigating the GMail DOM, I've picked a much simpler target. This script simply speaks the number of major sections (level 2 headings) in a Wikipedia article when the page loads. It's not as sexy, but the code is much easier to understand.</p>
<p>To try this script, make sure you have the Greasemonkey 0.8 and Outfox 0.3.5 extensions installed on Firefox 3.0 or 3.5. Then visit the following link to have GM install the script: <a href="/files/citation_announcer.user.js">citation_announcer.user.js</a>.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">// ==UserScript==</span>
<span style="color: #006600; font-style: italic;">// @name Sections count</span>
<span style="color: #006600; font-style: italic;">// @namespace http://www.mindtrove.info/</span>
<span style="color: #006600; font-style: italic;">// @description Speaks the number of h2 sections in a Wikipedia article</span>
<span style="color: #006600; font-style: italic;">// @include http://*.wikipedia.org/wiki/*</span>
<span style="color: #006600; font-style: italic;">// @require http://www.json.org/json2.js</span>
<span style="color: #006600; font-style: italic;">// @require http://outfox.googlecode.com/svn/trunk/js/outfox.js</span>
<span style="color: #006600; font-style: italic;">// ==/UserScript==</span>
&nbsp;
<span style="color: #006600; font-style: italic;">// number of major sections</span>
<span style="color: #003366; font-weight: bold;">var</span> sections <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> onOutfoxAudioInit<span style="color: #009900;">&#40;</span>response<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #006600; font-style: italic;">// say the number of main sections</span>
    outfox.<span style="color: #660066;">audio</span>.<span style="color: #660066;">say</span><span style="color: #009900;">&#40;</span>sections <span style="color: #339933;">+</span> <span style="color: #3366CC;">' main sections'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #006600; font-style: italic;">// return the parameter for other outfox deferred callbacks</span>
    <span style="color: #000066; font-weight: bold;">return</span> response<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> onOutfoxInit<span style="color: #009900;">&#40;</span>version<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #003366; font-weight: bold;">var</span> content <span style="color: #339933;">=</span> document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'bodyContent'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #006600; font-style: italic;">// count the number of main sections</span>
    sections <span style="color: #339933;">=</span> content.<span style="color: #660066;">getElementsByTagName</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'h2'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">length</span><span style="color: #339933;">;</span>
    <span style="color: #006600; font-style: italic;">// take one back for the TOC heading if it's present</span>
    <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'toc'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #339933;">--</span>sections<span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #006600; font-style: italic;">// start the outfox audio service</span>
    <span style="color: #003366; font-weight: bold;">var</span> def <span style="color: #339933;">=</span> outfox.<span style="color: #660066;">startService</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'audio'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    def.<span style="color: #660066;">addCallback</span><span style="color: #009900;">&#40;</span>onOutfoxAudioInit<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #006600; font-style: italic;">// return the parameter for other outfox deferred callbacks</span>
    <span style="color: #000066; font-weight: bold;">return</span> version<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> onDOMContentLoaded<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #006600; font-style: italic;">// create a node for outfox use</span>
    <span style="color: #003366; font-weight: bold;">var</span> div <span style="color: #339933;">=</span> document.<span style="color: #660066;">createElement</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'div'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    document.<span style="color: #660066;">body</span>.<span style="color: #660066;">appendChild</span><span style="color: #009900;">&#40;</span>div<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #006600; font-style: italic;">// initialize outfox</span>
    <span style="color: #003366; font-weight: bold;">var</span> def <span style="color: #339933;">=</span> outfox.<span style="color: #660066;">init</span><span style="color: #009900;">&#40;</span>div<span style="color: #339933;">,</span> JSON.<span style="color: #660066;">stringify</span><span style="color: #339933;">,</span> JSON.<span style="color: #660066;">parse</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    def.<span style="color: #660066;">addCallback</span><span style="color: #009900;">&#40;</span>onOutfoxInit<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">// this event triggers execution of the GM script</span>
onDOMContentLoaded<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://mindtrove.info/outfox-in-greasemonkey-revisited/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Spaceship!</title>
		<link>http://mindtrove.info/spaceship/</link>
		<comments>http://mindtrove.info/spaceship/#comments</comments>
		<pubDate>Sun, 24 May 2009 20:37:46 +0000</pubDate>
		<dc:creator>Peter Parente</dc:creator>
				<category><![CDATA[Accessibility]]></category>
		<category><![CDATA[HCI]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[a11y]]></category>
		<category><![CDATA[dojo]]></category>
		<category><![CDATA[game]]></category>
		<category><![CDATA[outfox]]></category>
		<category><![CDATA[spaceship]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://mindtrove.info/?p=200</guid>
		<description><![CDATA[When Gary announced Outfox back in 2008, all manner of ideas for using speech and sound in the browser popped into my head. I've always had the boring demos (i.e., for adults) at Maze Day, so I decided to work first on a fun, somewhat educational, self-voicing browser game for the 2009 rendition. After all, [...]]]></description>
			<content:encoded><![CDATA[<p>When Gary announced <a href="http://wwwx.cs.unc.edu/~gb/wp/blog/2008/07/27/outfox-speech-sound-and-more-for-firefox/">Outfox</a> back in 2008, all manner of ideas for using speech and sound in the browser popped into my head. I've always had the <a href="http://mindtrove.info/clique/">boring demos</a> (i.e., for adults) at <a href="http://wwwx.cs.unc.edu/~gb/wp/blog/2008/01/22/maze-day-2008/">Maze Day</a>, so I decided to work first on a fun, somewhat educational, self-voicing browser game for <a href="http://wwwx.cs.unc.edu/~gb/wp/blog/2009/02/15/maze-day-2009/">the 2009 rendition</a>. After all, keeping the mostly under-13, soda drinking, pizza eating, game playing clientele happy is always priority #1 at Maze Day.</p>
<p>The result is Spaceship!, a JavaScript game for Firefox built using <a href="http://creativecommons.org/">Creative Commons</a> licensed music, sound, speech, and graphics; the <a href="http://dojotoolkit.org">Dojo toolkit</a>; and the <a href="http://code.google.com/p/outfox">Outfox add-on</a>. In the primary portion of the game, the player fires shots at a grid of tiles trying to hit enemy ships. When the player runs out of ammo, he or she plays a set of minigames in an attempt to earn more shots. Of course, hazards and bonuses abound to keep things interesting.</p>
<p>A text description is nice, but you're better off watching the gameplay video below to really understand what I'm jabbering about. Or, better yet, grab <a href="http://code.google.com/p/outfox">Outfox</a> and <a href="http://www.mozilla.com/en-US/firefox/personal.html?from=getfirefox">Firefox 3</a> and play it yourself online at <a href="http://spaceship.mindtrove.info">http://spaceship.mindtrove.info</a>.</p>
<p><object width="640" height="480" data="http://vimeo.com/moogaloop.swf?clip_id=4812387&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=1&amp;color=FF7700&amp;fullscreen=1" type="application/x-shockwave-flash"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://vimeo.com/moogaloop.swf?clip_id=4812387&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=1&amp;color=FF7700&amp;fullscreen=1" /></object></p>
<p>What a great exercise this turned out to be!  The payoff has been manyfold:</p>
<ol>
<li>I learning a ton more about Dojo and writing custom widgets.</li>
<li>I developed some interesting MVC techniques for aural+visual event driven apps in Dojo. I hope to blog about these.</li>
<li>I built some nice, reusable Dojo components for future browser games.</li>
<li>I got to show off client-side music, sound, and speech in Firefox with pure JS. Maybe this will spur development of other audio apps?</li>
<li>I drummed up some interest in extending Spaceship! with new minigames. Hopefully more coming soon.</li>
<li>My wife was entertained. Yes, she will actually ask to play the game if she sees me working on it.</li>
<li>I had lots of teachers ask when the game will be online at Maze Day. Well, here it is, a month later.</li>
<li>And, most importantly, a steady stream of kids (and adults) got to play it at Maze Day. Hopefully even more can enjoy it now online.</li>
</ol>
<p>If you try it out, leave a comment. It's new, there are bugs, and there is room for improvement. But anything you report will help in making the game better.</p>
<p>I owe many thanks to the artists who made their wonderful images, songs, and sounds available under open licenses. Their names appear in the <em>Credits</em> section off the main game menu. Be sure to check them out.</p>
<p>Oh, and of course the game code itself is <a href="http://creativecommons.org/licenses/BSD/">BSD-licensed</a>. Grab the code from <del><a href="http://svn.mindtrove.info/spaceship">http://svn.mindtrove.info/spaceship</a></del> <a href="http://github.com/parente/spaceship">http://github.com/parente/spaceship</a> if you're feeling adventurous.</p>
]]></content:encoded>
			<wfw:commentRss>http://mindtrove.info/spaceship/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Outfoxing Gmail with Greasemonkey</title>
		<link>http://mindtrove.info/outfoxing-gmail-with-greasemonkey/</link>
		<comments>http://mindtrove.info/outfoxing-gmail-with-greasemonkey/#comments</comments>
		<pubDate>Wed, 30 Jul 2008 11:56:21 +0000</pubDate>
		<dc:creator>Peter Parente</dc:creator>
				<category><![CDATA[Accessibility]]></category>
		<category><![CDATA[Ideas]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[outfox]]></category>
		<category><![CDATA[pgo]]></category>
		<category><![CDATA[speech]]></category>

		<guid isPermaLink="false">http://mindtrove.info/?p=97</guid>
		<description><![CDATA[NOTE: The code in this post is out-of-date and does not work with recent versions of Outfox. See http://mindtrove.info/outfox-in-greasemonkey-revisited/ for a simpler, more compatible example. If you do update the GMail announcer code so it works with Outfox again, drop me a line and I'll link to your script. Can you remember a time when [...]]]></description>
			<content:encoded><![CDATA[<p><strong>NOTE</strong>: The code in this post is out-of-date and does not work with recent versions of Outfox. See http://mindtrove.info/outfox-in-greasemonkey-revisited/ for a simpler, more compatible example. If you do update the GMail announcer code so it works with Outfox again, drop me a line and I'll link to your script.</p>
<hr />
<p>Can you remember a time when the title of this blog post might have landed me in a straight jacket? Can you believe that was just a few short years ago? Yea, I can't either.</p>
<p>Anyway, Gary's post <a href="http://wwwx.cs.unc.edu/~gb/wp/blog/2008/07/27/outfox-speech-sound-and-more-for-firefox/">Outfox: speech, sound, and more for Firefox</a> talks about a new Firefox extension. He's using it to create cross-platform, self-voicing Web apps for kids with disabilities using a pure JS API. He hopes to extend his work to support alternative input devices such as game pads and switches as the Outfox extension matures and grows more flexible.</p>
<p>One of the other potential uses listed on the <a href="http://code.google.com/p/outfox">Outfox homepage</a> is <i>Adding new I/O to web sites with Greasemonkey</i>. Interesting. It's one thing to include Outfox explicitly in a page, but can it possibly work when injected by GM? What about for a complex app like Gmail with multiple iframes, dynamic changes, refreshing, etc.?</p>
<p>To learn about Outfox (and for fun), I decided to write a quick GM script for Gmail that announces the senders and times of new messages (bold items) in the inbox. (I would have done subject and summary too, but Outfox 0.1.0 appears to have some unicode issues and balked at some of the Gmail separator characters. Less is more at this point.) The script makes the announcement when the Gmail interface first loads, any time Gmail automatically refreshes its inbox view, or when the user clicks the refresh link to check for new mail. It is smart enough to announce a given message only once, however, so you don't hear the same message over and over again on each refresh.</p>
<p>Yes. It does actually work.</p>
<p>To try this script, make sure you have the Greasemonkey 0.8 and Outfox 0.1 extensions installed on Firefox 3. (Or use the latest available version of each.) Then visit the following link to have GM install the script: <a href="/files/gmail_announcer.user.js">gmail_announcer.user.js</a>.</p>
<p>For reference, the entire script is listed below:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">// ==UserScript==</span>
<span style="color: #006600; font-style: italic;">// @name Gmail Announcer</span>
<span style="color: #006600; font-style: italic;">// @namespace http://www.mindtrove.info/</span>
<span style="color: #006600; font-style: italic;">// @description Speaks new Gmail inbox messages using Outfox</span>
<span style="color: #006600; font-style: italic;">// @include https://mail.google.com/mail/*</span>
<span style="color: #006600; font-style: italic;">// @include http://mail.google.com/mail/*</span>
<span style="color: #006600; font-style: italic;">// @require http://outfox.googlecode.com/svn/trunk/js/outfox.js</span>
<span style="color: #006600; font-style: italic;">// ==/UserScript==</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">var</span> need_say <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">;</span>
<span style="color: #003366; font-weight: bold;">var</span> ids <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> sayMessages<span style="color: #009900;">&#40;</span>msgs<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>outfox.<span style="color: #660066;">defaults</span>.<span style="color: #660066;">config</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #006600; font-style: italic;">// outfox really needs a better way to detect ready ...</span>
	need_say <span style="color: #339933;">=</span> msgs<span style="color: #339933;">;</span>
	<span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #003366; font-weight: bold;">var</span> header <span style="color: #339933;">=</span> <span style="color: #3366CC;">'New messages'</span><span style="color: #339933;">;</span>
    <span style="color: #000066; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> id <span style="color: #000066; font-weight: bold;">in</span> msgs<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #006600; font-style: italic;">// say all messages</span>
	<span style="color: #003366; font-weight: bold;">var</span> msg <span style="color: #339933;">=</span> msgs<span style="color: #009900;">&#91;</span>id<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
	<span style="color: #003366; font-weight: bold;">var</span> segs <span style="color: #339933;">=</span> msg.<span style="color: #660066;">split</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Â»'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #003366; font-weight: bold;">var</span> sender <span style="color: #339933;">=</span> segs<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
	<span style="color: #003366; font-weight: bold;">var</span> time <span style="color: #339933;">=</span> segs<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span>.<span style="color: #660066;">slice</span><span style="color: #009900;">&#40;</span>segs<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span>.<span style="color: #660066;">search</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'â€¦'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">+</span><span style="color: #CC0000;">2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>header<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	    outfox.<span style="color: #660066;">say</span><span style="color: #009900;">&#40;</span>header<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	    header <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
	outfox.<span style="color: #660066;">say</span><span style="color: #009900;">&#40;</span>sender <span style="color: #339933;">+</span> <span style="color: #3366CC;">' at '</span> <span style="color: #339933;">+</span> time<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> onOutfoxReady<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>need_say<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #006600; font-style: italic;">// say anything already queued</span>
	sayMessages<span style="color: #009900;">&#40;</span>need_say<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	ids <span style="color: #339933;">=</span> need_say<span style="color: #339933;">;</span>
	need_say <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> onTableChange<span style="color: #009900;">&#40;</span>event<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #003366; font-weight: bold;">var</span> div <span style="color: #339933;">=</span> event.<span style="color: #660066;">target</span><span style="color: #339933;">;</span>
    <span style="color: #003366; font-weight: bold;">var</span> trs <span style="color: #339933;">=</span> div.<span style="color: #660066;">getElementsByTagName</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'tr'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #003366; font-weight: bold;">var</span> count <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>
    <span style="color: #003366; font-weight: bold;">var</span> new_ids <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
    <span style="color: #003366; font-weight: bold;">var</span> curr_ids <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
    <span style="color: #000066; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i<span style="color: #339933;">=</span><span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&lt;</span> trs.<span style="color: #660066;">length</span><span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #003366; font-weight: bold;">var</span> tr <span style="color: #339933;">=</span> trs<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
	<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>tr.<span style="color: #660066;">innerHTML</span>.<span style="color: #660066;">search</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'&amp;lt;b&amp;gt;'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">!=</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	    <span style="color: #006600; font-style: italic;">// marked as a new message</span>
	    <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>ids<span style="color: #009900;">&#91;</span>tr.<span style="color: #660066;">id</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">==</span> undefined<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #006600; font-style: italic;">// never announced</span>
		new_ids<span style="color: #009900;">&#91;</span>tr.<span style="color: #660066;">id</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> tr.<span style="color: #660066;">textContent</span><span style="color: #339933;">;</span>
		<span style="color: #339933;">++</span>count<span style="color: #339933;">;</span>
	    <span style="color: #009900;">&#125;</span>
	    <span style="color: #006600; font-style: italic;">// curr is announced + new</span>
	    curr_ids<span style="color: #009900;">&#91;</span>tr.<span style="color: #660066;">id</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> tr.<span style="color: #660066;">textContent</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #006600; font-style: italic;">// report if we can</span>
    <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>sayMessages<span style="color: #009900;">&#40;</span>new_ids<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	ids <span style="color: #339933;">=</span> curr_ids<span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span> 
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> onDocumentChange<span style="color: #009900;">&#40;</span>event<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>event.<span style="color: #660066;">target</span>.<span style="color: #660066;">tagName</span> <span style="color: #339933;">==</span> <span style="color: #3366CC;">'DIV'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #003366; font-weight: bold;">var</span> div <span style="color: #339933;">=</span> event.<span style="color: #660066;">target</span><span style="color: #339933;">;</span>
	<span style="color: #003366; font-weight: bold;">var</span> tables <span style="color: #339933;">=</span> div.<span style="color: #660066;">getElementsByTagName</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'table'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000066; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i <span style="color: #000066; font-weight: bold;">in</span> tables<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	    <span style="color: #003366; font-weight: bold;">var</span> table <span style="color: #339933;">=</span> tables<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
	    <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>table.<span style="color: #660066;">id</span> <span style="color: #339933;">!=</span> <span style="color: #3366CC;">''</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #339933;">!</span>table.<span style="color: #660066;">getAttribute</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'role'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #006600; font-style: italic;">// watch just table changes from now on</span>
		<span style="color: #003366; font-weight: bold;">var</span> div <span style="color: #339933;">=</span> table.<span style="color: #660066;">parentNode</span>.<span style="color: #660066;">parentNode</span><span style="color: #339933;">;</span>
		div.<span style="color: #660066;">addEventListener</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'DOMNodeInserted'</span><span style="color: #339933;">,</span> onTableChange<span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		document.<span style="color: #660066;">removeEventListener</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'DOMNodeInserted'</span><span style="color: #339933;">,</span> 
					     onDocumentChange<span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #006600; font-style: italic;">// start outfox</span>
		<span style="color: #003366; font-weight: bold;">var</span> div <span style="color: #339933;">=</span> document.<span style="color: #660066;">createElement</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'div'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		document.<span style="color: #660066;">body</span>.<span style="color: #660066;">appendChild</span><span style="color: #009900;">&#40;</span>div<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		outfox.<span style="color: #660066;">init</span><span style="color: #009900;">&#40;</span>div<span style="color: #339933;">,</span> onOutfoxReady<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #006600; font-style: italic;">// kick off initial read manually</span>
		onTableChange<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span><span style="color: #3366CC;">'target'</span> <span style="color: #339933;">:</span> table.<span style="color: #660066;">parentNode</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	    <span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
document.<span style="color: #660066;">addEventListener</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'DOMNodeInserted'</span><span style="color: #339933;">,</span> onDocumentChange<span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://mindtrove.info/outfoxing-gmail-with-greasemonkey/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
