<?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>Mike Conley&#039;s Blog &#187; firefox</title>
	<atom:link href="http://mikeconley.ca/blog/tag/firefox/feed/" rel="self" type="application/rss+xml" />
	<link>http://mikeconley.ca/blog</link>
	<description>The personal blog of a Toronto based software developer, musician, sound designer, and theatre enthusiast.</description>
	<lastBuildDate>Fri, 11 May 2012 15:23:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Cut the Rope in HTML5 and Javascript</title>
		<link>http://mikeconley.ca/blog/2012/01/10/cut-the-rope-in-html5-and-javascript/</link>
		<comments>http://mikeconley.ca/blog/2012/01/10/cut-the-rope-in-html5-and-javascript/#comments</comments>
		<pubDate>Tue, 10 Jan 2012 13:58:35 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[Firefox]]></category>
		<category><![CDATA[Mozilla]]></category>
		<category><![CDATA[cut the rope]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[games]]></category>
		<category><![CDATA[gaming]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://mikeconley.ca/blog/?p=2254</guid>
		<description><![CDATA[The developers of the puzzle game Cut The Rope have ported their code from Objective-C to Javascript and HTML5. And, despite the IE slant, the game works really well in Firefox!  Check it out: Visit http://www.cuttherope.ie to try it out!]]></description>
			<content:encoded><![CDATA[<p>The developers of the puzzle game Cut The Rope have ported their code from Objective-C to Javascript and HTML5.</p>
<p>And, despite the IE slant, the game works really well in Firefox!  Check it out:</p>
<p><a href="http://imgur.com/IRdiQ"><img title="Hosted by imgur.com" src="http://i.imgur.com/IRdiQ.jpg" alt="" /></a></p>
<p><a href="http://www.cuttherope.ie">Visit http://www.cuttherope.ie to try it out!</a></p>
]]></content:encoded>
			<wfw:commentRss>http://mikeconley.ca/blog/2012/01/10/cut-the-rope-in-html5-and-javascript/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>My Thunderbird / Firefox wallet &#8211; one of a kind</title>
		<link>http://mikeconley.ca/blog/2011/12/11/my-thunderbird-firefox-wallet-one-of-a-kind/</link>
		<comments>http://mikeconley.ca/blog/2011/12/11/my-thunderbird-firefox-wallet-one-of-a-kind/#comments</comments>
		<pubDate>Sun, 11 Dec 2011 18:45:35 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[Firefox]]></category>
		<category><![CDATA[Mozilla]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[Thunderbird]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[joel beck]]></category>
		<category><![CDATA[leather]]></category>
		<category><![CDATA[mozilla]]></category>
		<category><![CDATA[thunderbird]]></category>
		<category><![CDATA[wallet]]></category>

		<guid isPermaLink="false">http://mikeconley.ca/blog/?p=2229</guid>
		<description><![CDATA[My friend Joel Beck is kind of a badass. When he&#8217;s not designing / building reactors for Atlantic Hydrogen in New Brunswick, he&#8217;s learning all sorts of cool skills. Skills like leather-working. Look what he gave me as an early Xmas gift: This is a one-of-a-kind, hand-made leather wallet, made by my good friend Joel [...]]]></description>
			<content:encoded><![CDATA[<p>My friend Joel Beck is kind of a badass.</p>
<p>When he&#8217;s not designing / building reactors for Atlantic Hydrogen in New Brunswick, he&#8217;s learning all sorts of cool skills.</p>
<p>Skills like leather-working.</p>
<p>Look what he gave me as an early Xmas gift:</p>
<div class="shashinPhotoGroups"><table class="shashinThumbnailsTable" id="shashinGroup_1_1" style="margin-left: auto; margin-right: auto;">
<caption></caption>
<tr>
<td><div class="shashinThumbnailDiv" id="shashinThumbnailDiv_1" style="width: 306px;"><a href="https://lh4.googleusercontent.com/-hFDWEAbDhts/TuT18FjDZPI/AAAAAAAABrA/BYjXWOVDtyE/IMG_20111210_224439.jpg?imgmax=800" id="shashinThumbnailLink_1" class="shashinFancybox" rel="shashinFancybox_1" title="A hand-made leather wallet by my friend Joel Beck"><img src="https://lh4.googleusercontent.com/-hFDWEAbDhts/TuT18FjDZPI/AAAAAAAABrA/BYjXWOVDtyE/IMG_20111210_224439.jpg?imgmax=320" alt="A hand-made leather wallet by my friend Joel Beck" width="300" height="225" class="shashinThumbnailImage" id="shashinThumbnailImage_1" /></a><div class="shashinFancyboxCaptionWrapper" id="shashinFancyboxCaption_1">
<div class="shashinFancyboxCaption">
<div class="shashinFancyboxCaptionClose"><a href="javascript:;" onclick="jQuery.fancybox.close();"><img src="http://mikeconley.ca/blog/wp-content/plugins/shashin/Public/Display/fancybox/closelabel.gif" /></a></div>
<div class="shashinLinkToOriginalPhoto"><a href="https://picasaweb.google.com/102046754196003513928/MyThunderbirdFirefoxWalletFromJoelBeck?authkey=Gv1sRgCNDglNG86uuzlAE#5684939042278565106">View at Picasa</a></div>
<strong>A hand-made leather wallet by my friend Joel Beck<span class="shashinCaptionExif">10-Dec-2011 22:44, google Nexus S, 2.6, 3.43mm, 0.017 sec, ISO 50</span></strong><!-- comment for image counter --></div>
</div>

</div></td>
</tr>
<tr>
<td><div class="shashinThumbnailDiv" id="shashinThumbnailDiv_2" style="width: 306px;"><a href="https://lh5.googleusercontent.com/-BCqG__dBnRU/TuT1phwCW2I/AAAAAAAABqM/m_m8G1YVcuQ/IMG_20111210_224455.jpg?imgmax=800" id="shashinThumbnailLink_2" class="shashinFancybox" rel="shashinFancybox_1" title="Thunderbird!"><img src="https://lh5.googleusercontent.com/-BCqG__dBnRU/TuT1phwCW2I/AAAAAAAABqM/m_m8G1YVcuQ/IMG_20111210_224455.jpg?imgmax=320" alt="Thunderbird!" width="300" height="225" class="shashinThumbnailImage" id="shashinThumbnailImage_2" /></a><div class="shashinFancyboxCaptionWrapper" id="shashinFancyboxCaption_2">
<div class="shashinFancyboxCaption">
<div class="shashinFancyboxCaptionClose"><a href="javascript:;" onclick="jQuery.fancybox.close();"><img src="http://mikeconley.ca/blog/wp-content/plugins/shashin/Public/Display/fancybox/closelabel.gif" /></a></div>
<div class="shashinLinkToOriginalPhoto"><a href="https://picasaweb.google.com/102046754196003513928/MyThunderbirdFirefoxWalletFromJoelBeck?authkey=Gv1sRgCNDglNG86uuzlAE#5684938723431701346">View at Picasa</a></div>
<strong>Thunderbird!<span class="shashinCaptionExif">10-Dec-2011 22:44, google Nexus S, 2.6, 3.43mm, 0.008 sec, ISO 50</span></strong><!-- comment for image counter --></div>
</div>

</div></td>
</tr>
<tr>
<td><div class="shashinThumbnailDiv" id="shashinThumbnailDiv_3" style="width: 306px;"><a href="https://lh3.googleusercontent.com/-aufv-eT4L7w/TuT10VqdzII/AAAAAAAABqU/33PpCXZEyqA/IMG_20111210_224449.jpg?imgmax=800" id="shashinThumbnailLink_3" class="shashinFancybox" rel="shashinFancybox_1" title="Firefox!"><img src="https://lh3.googleusercontent.com/-aufv-eT4L7w/TuT10VqdzII/AAAAAAAABqU/33PpCXZEyqA/IMG_20111210_224449.jpg?imgmax=320" alt="Firefox!" width="300" height="225" class="shashinThumbnailImage" id="shashinThumbnailImage_3" /></a><div class="shashinFancyboxCaptionWrapper" id="shashinFancyboxCaption_3">
<div class="shashinFancyboxCaption">
<div class="shashinFancyboxCaptionClose"><a href="javascript:;" onclick="jQuery.fancybox.close();"><img src="http://mikeconley.ca/blog/wp-content/plugins/shashin/Public/Display/fancybox/closelabel.gif" /></a></div>
<div class="shashinLinkToOriginalPhoto"><a href="https://picasaweb.google.com/102046754196003513928/MyThunderbirdFirefoxWalletFromJoelBeck?authkey=Gv1sRgCNDglNG86uuzlAE#5684938909165669506">View at Picasa</a></div>
<strong>Firefox!<span class="shashinCaptionExif">10-Dec-2011 22:44, google Nexus S, 2.6, 3.43mm, 0.008 sec, ISO 100</span></strong><!-- comment for image counter --></div>
</div>

</div></td>
</tr>
<tr>
<td><div class="shashinThumbnailDiv" id="shashinThumbnailDiv_4" style="width: 306px;"><a href="https://lh4.googleusercontent.com/-ZSYddXA2WDI/TuT1hPX_A9I/AAAAAAAABqE/joG-JrXNGlY/IMG_20111210_224510.jpg?imgmax=800" id="shashinThumbnailLink_4" class="shashinFancybox" rel="shashinFancybox_1"><img src="https://lh4.googleusercontent.com/-ZSYddXA2WDI/TuT1hPX_A9I/AAAAAAAABqE/joG-JrXNGlY/IMG_20111210_224510.jpg?imgmax=320" alt="" width="300" height="225" class="shashinThumbnailImage" id="shashinThumbnailImage_4" /></a><div class="shashinFancyboxCaptionWrapper" id="shashinFancyboxCaption_4">
<div class="shashinFancyboxCaption">
<div class="shashinFancyboxCaptionClose"><a href="javascript:;" onclick="jQuery.fancybox.close();"><img src="http://mikeconley.ca/blog/wp-content/plugins/shashin/Public/Display/fancybox/closelabel.gif" /></a></div>
<div class="shashinLinkToOriginalPhoto"><a href="https://picasaweb.google.com/102046754196003513928/MyThunderbirdFirefoxWalletFromJoelBeck?authkey=Gv1sRgCNDglNG86uuzlAE#5684938581060027346">View at Picasa</a></div>
<strong><span class="shashinCaptionExif">10-Dec-2011 22:45, google Nexus S, 2.6, 3.43mm, 0.008 sec, ISO 100</span></strong><!-- comment for image counter --></div>
</div>

</div></td>
</tr>
<tr>
<td><div class="shashinThumbnailDiv" id="shashinThumbnailDiv_5" style="width: 306px;"><a href="https://lh5.googleusercontent.com/-chTIwe1e1zE/TuT1aPvMNRI/AAAAAAAABp8/2_929OqtPwI/IMG_20111210_224519.jpg?imgmax=800" id="shashinThumbnailLink_5" class="shashinFancybox" rel="shashinFancybox_1"><img src="https://lh5.googleusercontent.com/-chTIwe1e1zE/TuT1aPvMNRI/AAAAAAAABp8/2_929OqtPwI/IMG_20111210_224519.jpg?imgmax=320" alt="" width="300" height="225" class="shashinThumbnailImage" id="shashinThumbnailImage_5" /></a><div class="shashinFancyboxCaptionWrapper" id="shashinFancyboxCaption_5">
<div class="shashinFancyboxCaption">
<div class="shashinFancyboxCaptionClose"><a href="javascript:;" onclick="jQuery.fancybox.close();"><img src="http://mikeconley.ca/blog/wp-content/plugins/shashin/Public/Display/fancybox/closelabel.gif" /></a></div>
<div class="shashinLinkToOriginalPhoto"><a href="https://picasaweb.google.com/102046754196003513928/MyThunderbirdFirefoxWalletFromJoelBeck?authkey=Gv1sRgCNDglNG86uuzlAE#5684938460898276626">View at Picasa</a></div>
<strong><span class="shashinCaptionExif">10-Dec-2011 22:45, google Nexus S, 2.6, 3.43mm, 0.008 sec, ISO 50</span></strong><!-- comment for image counter --></div>
</div>

</div></td>
</tr>
<tr>
<td><div class="shashinThumbnailDiv" id="shashinThumbnailDiv_6" style="width: 306px;"><a href="https://lh3.googleusercontent.com/-QPrOtgLhmSY/TuT1SYmFEWI/AAAAAAAABp0/F9550bmF6Gg/IMG_20111210_224525.jpg?imgmax=800" id="shashinThumbnailLink_6" class="shashinFancybox" rel="shashinFancybox_1" title="Just look at that detail."><img src="https://lh3.googleusercontent.com/-QPrOtgLhmSY/TuT1SYmFEWI/AAAAAAAABp0/F9550bmF6Gg/IMG_20111210_224525.jpg?imgmax=320" alt="Just look at that detail." width="300" height="225" class="shashinThumbnailImage" id="shashinThumbnailImage_6" /></a><div class="shashinFancyboxCaptionWrapper" id="shashinFancyboxCaption_6">
<div class="shashinFancyboxCaption">
<div class="shashinFancyboxCaptionClose"><a href="javascript:;" onclick="jQuery.fancybox.close();"><img src="http://mikeconley.ca/blog/wp-content/plugins/shashin/Public/Display/fancybox/closelabel.gif" /></a></div>
<div class="shashinLinkToOriginalPhoto"><a href="https://picasaweb.google.com/102046754196003513928/MyThunderbirdFirefoxWalletFromJoelBeck?authkey=Gv1sRgCNDglNG86uuzlAE#5684938325837025634">View at Picasa</a></div>
<strong>Just look at that detail.<span class="shashinCaptionExif">10-Dec-2011 22:45, google Nexus S, 2.6, 3.43mm, 0.003 sec, ISO 50</span></strong><!-- comment for image counter --></div>
</div>

</div></td>
</tr>
<tr>
<td><div class="shashinThumbnailDiv" id="shashinThumbnailDiv_7" style="width: 306px;"><a href="https://lh3.googleusercontent.com/-GrIZQDaHT4k/TuT05zv717I/AAAAAAAABps/XhfMakImYkg/IMG_20111210_224532.jpg?imgmax=800" id="shashinThumbnailLink_7" class="shashinFancybox" rel="shashinFancybox_1" title="Mind = blown."><img src="https://lh3.googleusercontent.com/-GrIZQDaHT4k/TuT05zv717I/AAAAAAAABps/XhfMakImYkg/IMG_20111210_224532.jpg?imgmax=320" alt="Mind = blown." width="300" height="225" class="shashinThumbnailImage" id="shashinThumbnailImage_7" /></a><div class="shashinFancyboxCaptionWrapper" id="shashinFancyboxCaption_7">
<div class="shashinFancyboxCaption">
<div class="shashinFancyboxCaptionClose"><a href="javascript:;" onclick="jQuery.fancybox.close();"><img src="http://mikeconley.ca/blog/wp-content/plugins/shashin/Public/Display/fancybox/closelabel.gif" /></a></div>
<div class="shashinLinkToOriginalPhoto"><a href="https://picasaweb.google.com/102046754196003513928/MyThunderbirdFirefoxWalletFromJoelBeck?authkey=Gv1sRgCNDglNG86uuzlAE#5684937903629391794">View at Picasa</a></div>
<strong>Mind = blown.<span class="shashinCaptionExif">10-Dec-2011 22:45, google Nexus S, 2.6, 3.43mm, 0.004 sec, ISO 50</span></strong><!-- comment for image counter --></div>
</div>

</div></td>
</tr>
</table>
</div>

<p>This is a one-of-a-kind, hand-made leather wallet, made by my good friend Joel Beck.</p>
<p>Thanks Joel.</p>
]]></content:encoded>
			<wfw:commentRss>http://mikeconley.ca/blog/2011/12/11/my-thunderbird-firefox-wallet-one-of-a-kind/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Day 1 at Mozilla Messaging:  Getting my hands dirty&#8230;</title>
		<link>http://mikeconley.ca/blog/2011/01/17/day-1-at-mozilla-messaging-getting-my-hands-dirty/</link>
		<comments>http://mikeconley.ca/blog/2011/01/17/day-1-at-mozilla-messaging-getting-my-hands-dirty/#comments</comments>
		<pubDate>Tue, 18 Jan 2011 04:15:02 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[Firefox]]></category>
		<category><![CDATA[Mozilla]]></category>
		<category><![CDATA[add-ons]]></category>
		<category><![CDATA[blake winton]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[first day]]></category>
		<category><![CDATA[mozilla]]></category>
		<category><![CDATA[mozilla messaging]]></category>
		<category><![CDATA[newbie]]></category>
		<category><![CDATA[schwartzian transform]]></category>
		<category><![CDATA[sorting]]></category>
		<category><![CDATA[thunderbird]]></category>

		<guid isPermaLink="false">http://mikeconley.ca/blog/?p=1930</guid>
		<description><![CDATA[So today was my first day working for Mozilla Messaging. And it was awesome. Now, I know that I had originally told you that I&#8217;d be working on Thunderbird + Unity integration.  That&#8217;s still on my TODO list, but today, I put some contributions in with the Firefox team for the upcoming Firefox 4 release.  [...]]]></description>
			<content:encoded><![CDATA[<p>So today was my first day working for Mozilla Messaging.</p>
<p>And it was <strong>awesome</strong>.</p>
<p>Now, I know that <a href="http://mikeconley.ca/blog/2011/01/11/starting-work-on-mozilla-thunderbird/">I had originally told you that I&#8217;d be working on Thunderbird + Unity integration</a>.  That&#8217;s still on my TODO list, but today, I put some contributions in with the Firefox team for <a href="http://en.wikipedia.org/wiki/Firefox_4">the upcoming Firefox 4 release</a>.  There are still a few bugs that need to be squashed before Firefox 4 is ready for the prime-time, and we&#8217;re all psyched to see it happen, so I lent a hand.</p>
<p><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=624808 ">This was the bug I decided to tackle today.</a> Basically, in the new add-ons manager, add-ons are listed alphabetically, regardless of their state (and by state, I mean enabled, disabled, incompatible, blocked, etc).  This leads to kind of a strip-ey look for large numbers of add-ons.</p>
<p>What we&#8217;d like instead is to have the add-ons grouped by state, and then sorted alphabetically within that state.  Here&#8217;s a mock-up by bug-reporter (and Firefox UX team member) Jennifer Boriss:</p>
<p><a href="http://mikeconley.ca/blog/wp-content/uploads/2011/01/addons_inlist_accordingtostatus.png"><img title="Add-ons in list, grouped by status" src="http://mikeconley.ca/blog/wp-content/uploads/2011/01/addons_inlist_accordingtostatus-237x300.png" alt="Add-ons in list, grouped by status" width="308" height="389" /></a></p>
<p>I got to work around 8:45AM this morning.  Around 10:13AM, I had finished most of my introductions, had my tour, had my accounts set up, found my desk, and started work.</p>
<p>The first thing I did was locate where exactly the code was for listing the add-ons.  <a href="http://weblog.latte.ca/blake/ ">Blake</a> pointed out <a href="http://mxr.mozilla.org/">a particularly useful resource called MXR (Mozilla Cross Reference)</a>, which lets me search through the source code very quickly.  I had originally been using <a href="http://en.wikipedia.org/wiki/Grep">grep</a>, but this was way better.</p>
<p>My approach to finding the code:  I find a string in the interface that seems unique to the area I&#8217;m working in (in this case, it was &#8220;Search all add-ons&#8221;, which is found in the search text input of the add-ons manager).  I did a search for that string, and it returned the file ﻿﻿mozilla-central/toolkit/locales/en-US/chrome/mozapps/extensions/extensions.dtd.</p>
<p>But this only takes us half-way.  Since Firefox is translated, the strings are stored separately from where they&#8217;re used.  In extensions.dtd, the string I searched for is given the key &#8220;search.placeholder&#8221;.</p>
<p>Searching for &#8220;search.placeholder&#8221; with MXR gives me paydirt:  mozilla-central/toolkit/mozapps/extensions/content/ holds the files extensions.css, extensions.js, extensions.xul and extensions.xml.</p>
<p>So I tool around in extensions.js a bit, reading <a href="https://developer.mozilla.org/En/Developer_Guide">the developer documentation</a>, and getting to know the code.  The code contains quite a few classes, including something called gViewController.  Digging deeper into it, it looks like gViewController controls (brings up, shuts down) the various &#8220;views&#8221; available in the add-ons manager.  Cool &#8211; so now I just need to find the view that lists the user&#8217;s add-ons.</p>
<p>Ah hah!  Found it:  gListView.  gListView grabs all of the installed (or to-be-installed) add-ons, and populates the interface.  So this is where the sorting needs to happen.  I tested to make sure I was in the right place in the code <a href="https://developer.mozilla.org/en/Debugging_JavaScript">by using dump calls to a terminal</a>.  Bonus:  edits in this portion of the code do not require a full browser restart &#8211; instead, I just close and reopen the add-ons manager to see my changes.  Nice!</p>
<p>Initially, my idea was to have 4 &#8220;buckets&#8221;, one for each of the 4 states (&#8220;enabled&#8221;, &#8220;incompatible&#8221;, &#8220;disabled&#8221;, &#8220;blocked&#8221;).  I&#8217;d divide up the add-ons into those 4 buckets, and then sort each bucket, and then join the 4 buckets for the final result.</p>
<p>Blake came up with a better solution: the <a href="http://en.wikipedia.org/wiki/Schwartzian_transform">Schwartzian Transform</a> (straight out of <a href="http://en.wikipedia.org/wiki/Space_Balls">Space Balls</a>, I know).  The idea is that, instead of having separate buckets like before, we just go through the entire collection of add-ons, and &#8220;label&#8221; them based on what bucket they belong to.  Then we sort the entire collection, giving the bucket-label a high-order sorting priority.  It sounds complicated, but it actually wasn&#8217;t that difficult to code.  It&#8217;s a tiny piece of code, its readable, and quite elegant.  So kudos to Blake for that solution.</p>
<p>Anyhow, I wrote my patch.  I just figured out how to run the interface tests for Firefox (they use something called <a href="https://developer.mozilla.org/en/Mochitest">Mochitest</a>).  I set those tests off on one of the fast machines in the office, packed up my gear, and headed home.</p>
<p>It was a solid days work.  Tomorrow, I hope to write some new tests for the Schwartzian transform, and submit my patch to Bugzilla.  Woop!</p>
]]></content:encoded>
			<wfw:commentRss>http://mikeconley.ca/blog/2011/01/17/day-1-at-mozilla-messaging-getting-my-hands-dirty/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Code Spelunking for Students</title>
		<link>http://mikeconley.ca/blog/2009/11/03/code-spelunking-for-students/</link>
		<comments>http://mikeconley.ca/blog/2009/11/03/code-spelunking-for-students/#comments</comments>
		<pubDate>Tue, 03 Nov 2009 15:11:43 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[Computer Science]]></category>
		<category><![CDATA[architecture]]></category>
		<category><![CDATA[blueprints]]></category>
		<category><![CDATA[code spelunking]]></category>
		<category><![CDATA[exploring code]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[fsoss]]></category>
		<category><![CDATA[large code]]></category>
		<category><![CDATA[metaphors]]></category>
		<category><![CDATA[students]]></category>

		<guid isPermaLink="false">http://mikeconley.ca/blog/?p=907</guid>
		<description><![CDATA[Last Friday, I went to the FSOSS conference at Seneca@York Campus with Zuzel and Greg. One of the talks I attended was an open discussion about getting students involved in open source software. I&#8217;m going off of memory there, but I believe one of the speakers at that talk said something like: Students generally don&#8217;t [...]]]></description>
			<content:encoded><![CDATA[<p>Last Friday, I went to the <a href="http://fsoss.senecac.on.ca/2009/">FSOSS conference at Seneca@York Campus</a> with <a href="zuzelvp47uoft.wordpress.com">Zuzel</a> and <a href="http://www.third-bit.com">Greg</a>.</p>
<p>One of the talks I attended was an open discussion about <a href="http://teachingopensource.org/index.php/Main_Page">getting students involved in open source software</a>.</p>
<p>I&#8217;m going off of memory there, but I believe one of the speakers at that talk said something like:</p>
<blockquote><p>Students generally don&#8217;t have to deal with large code-bases in their school assignments&#8230;1000 lines of code is really nothing.  When students work on an open source project, they get dropped into a massive code-base with only a fork, a spoon, and a compass.  They have to find their way around, and that&#8217;s where the real challenge and learning is.  This is a skill that most students just don&#8217;t get with normal school assignments.</p></blockquote>
<p>Again, I&#8217;m paraphrasing.</p>
<p>So is this true?  Hm.</p>
<p>During my undergraduate career, I&#8217;ve certainly had to explore strange code that someone else has written.  But nothing even close to the size of, say, <a href="http://hg.mozilla.org/mozilla-central/file/b194e6c3f210">the Mozilla Firefox code-base</a>.  <a href="http://src.chromium.org/svn/trunk/src/">Or the Chromium code-base</a>.  I mean, these are <em>massive</em> wads of code.  This is not a criticism of my teachers or the UofT CS program by any means &#8211; it&#8217;s just an observation.</p>
<p>But some students explore these large code-bases on their own in their free time.  During my (admittedly brief) break before summer work began, I started poking around the Firefox code.  I made two discoveries:</p>
<ol>
<li>The code that I saw was, in my opinion, very well written</li>
<li>I was completely lost, and didn&#8217;t know where to start</li>
</ol>
<p>I still haven&#8217;t worked on any software that is nearly as large as Firefox.  Not even close.  <a href="http://www.markusproject.org/">MarkUs is a nice chunk of code</a>, but minuscule in comparison.</p>
<p>So just go with me on this for a second.  Let&#8217;s assume that a large code base is intimidating and difficult for students to wrap their heads around, and this is one of the main challenges in getting those students to contribute to open source software.</p>
<p>Again, I only have my own experience to back up that claim.  Looking at Firefox, I didn&#8217;t know where to start.  I didn&#8217;t know where to go.  I didn&#8217;t know which way was up.  I was lost.</p>
<p>So how can students get a better grasp on a mountain of code?  A few ideas:</p>
<ol>
<li>Write tests for the code, starting small and going big.  This is a relatively easy way to play with the code without having to change it. This assumes, of course, that the software has been designed to be easy to test&#8230;</li>
<li>Ask someone else.  Go into the appropriate IRC channel and ask around.  <a href="http://www.advogato.org/article/534.html">This, of course, has</a> <a href="http://www.linuxquestions.org/questions/general-10/newbie-subspecies-427558/#post2164604">it&#8217;s own problems.</a></li>
<li>Read up on the developer documentation.  Let&#8217;s just hope it&#8217;s up to date and relevant&#8230;</li>
<li>Read up on someone else&#8217;s experiences exploring the same code base.  Good luck finding those.</li>
</ol>
<h3>Not Quite Blueprints</h3>
<p>I&#8217;ve always thought of computer software as being like an invisible machine inside my computer.</p>
<p>And to me, the source code is a bit like <em>the description of the blueprints for that invisible machine</em>.  It&#8217;s not the top-down crystal-clear cutaways that a blueprint provides&#8230;it&#8217;s a flat, textual interpretation of those blueprints.  And it takes quite a bit of reading before those descriptions sink in, and the &#8220;personality&#8221; of the machine becomes clearer.</p>
<p>In his article &#8220;<a href="http://portal.acm.org/citation.cfm?id=1483101.1483108&amp;coll=portal&amp;dl=ACM&amp;CFID=59709049&amp;CFTOKEN=94558100">Code Spelunking Redux</a>&#8220;, <a href="http://www.neville-neil.com/">George V. Neville-Neil</a> says:</p>
<blockquote><p>Working in this way is a bit like trying to understand the United States by staring at a street sign in New York City. The ability to look at a high-level representation of the underlying system without the fine details would be perhaps the best tool for the code spelunker. Being able to think of software as a map that can be navigated in different ways—for example, by class relations and call graphs—would make code spelunkers far more productive.</p></blockquote>
<p>I was thinking a lot about that on my ride home from FSOSS.  When I got home to my computer, I found out that there are some really cool alternative ways of viewing software.  Here are three that I found quite interesting:</p>
<h3><a href="http://www.inf.usi.ch/phd/wettel/codecity.html">Codecity</a></h3>
<p>Imagine that you&#8217;re curious about developing on Firefox.  You can wade through the swaths of source code&#8230;</p>
<p><em>or you can stroll through a city that represents the software</em>:</p>
<div class="wp-caption alignnone" style="width: 521px"><a href="http://www.inf.usi.ch/phd/wettel/codecity.html"><img title="CodeCity" src="http://www.inf.usi.ch/phd/wettel/pics/codecity_screenshot.png" alt="CodeCity" width="511" height="279" /></a><p class="wp-caption-text">CodeCity</p></div>
<blockquote><p>CodeCity is an integrated environment for software analysis, in which software systems are visualized as interactive, navigable 3D cities. The classes are represented as buildings in the city, while the packages are depicted as the districts in which the buildings reside. The visible properties of the city artifacts depict a set of chosen software metrics, as in the polymetric views of <a href="http://www.inf.unisi.ch/faculty/lanza/codecrawler.html">CodeCrawler</a>.</p></blockquote>
<p>Imagine virtually driving around that city, hearing a guided tour through your headphones&#8230;you can walk into buildings, check out the different floors&#8230;check the plumbing.  Interesting idea.</p>
<h3><a href="http://seal.ifi.uzh.ch/cocoviz/">Cocoviz</a></h3>
<p>Or how about a neighbourhood&#8230;</p>
<div class="wp-caption alignnone" style="width: 610px"><a href="http://seal.ifi.uzh.ch/cocoviz/"><img title="CocoViz" src="http://seal.ifi.uzh.ch/uploads/pics/CocoVizToolKl.png" alt="CocoViz" width="600" height="370" /></a><p class="wp-caption-text">CocoViz</p></div>
<blockquote><p>CocoViz address software comprehension by a combination of visualization and audio. It uses common place metaphors (like houses) for an intuitive understanding of software structures and evolution.</p>
<p>For each source code entity, evolution and structural aspects are mapped to such metaphors and annotated with different audio, to represent concepts such as design erosion, code smells or evolution metrics.</p>
<p>The tool is used in the software evolution analysis domain but offers DB-, XML-importer and a plugin architecture to extend its use into other domains.</p></blockquote>
<h3>EvoSpaces</h3>
<p>Another attempt at using the architecture/neighbourhood metaphor.  This one does a neat job of displaying execution traces though &#8211; <a href="http://www.inf.unisi.ch/projects/evospaces/tool/evospaces_demo.avi">check out the video demo</a>.</p>
<p>These are cool ideas.</p>
<p><em>But are they useful? Are they usable?  Do they work? </em>Could they help students get a firm grasp on a large code-base?  Can they help visualize the evolution of software?</p>
<p>Has anyone actually used any of these?</p>
]]></content:encoded>
			<wfw:commentRss>http://mikeconley.ca/blog/2009/11/03/code-spelunking-for-students/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
<enclosure url="http://www.inf.unisi.ch/projects/evospaces/tool/evospaces_demo.avi" length="163227648" type="video/x-msvideo" />
		</item>
		<item>
		<title>alertCheck Grows Up</title>
		<link>http://mikeconley.ca/blog/2009/09/30/alertcheck-grows-up/</link>
		<comments>http://mikeconley.ca/blog/2009/09/30/alertcheck-grows-up/#comments</comments>
		<pubDate>Wed, 30 Sep 2009 22:19:11 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[alertCheck]]></category>
		<category><![CDATA[add-on]]></category>
		<category><![CDATA[alert]]></category>
		<category><![CDATA[extension]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[mozilla]]></category>
		<category><![CDATA[suppress]]></category>

		<guid isPermaLink="false">http://mikeconley.ca/blog/?p=819</guid>
		<description><![CDATA[Remember that Firefox add-on I wrote up a while back &#8211; the one that allows you to suppress annoying alert popups? Some updates: alertCheck just went public on Mozilla Add-ons after being reviewed by an add-ons editor As of this writing, alertCheck has 740 downloads As of this writing, alertCheck has 4 reviews &#8211; all [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://mikeconley.ca/blog/category/technology/firefox-extensions/alertcheck-firefox-extensions-technology/">Remember that Firefox add-on I wrote up a while back</a> &#8211; the one that <a href="https://addons.mozilla.org/en-US/firefox/addon/13176">allows you to suppress annoying alert popups?</a></p>
<p>Some updates:</p>
<ul>
<li>alertCheck just went public on Mozilla Add-ons after being reviewed by an add-ons editor</li>
<li>As of this writing, alertCheck has 740 downloads</li>
<li>As of this writing, alertCheck has <a href="https://addons.mozilla.org/en-US/firefox/reviews/display/13176">4 reviews</a> &#8211; all positive</li>
</ul>
<p>Not bad for my first add-on!</p>
]]></content:encoded>
			<wfw:commentRss>http://mikeconley.ca/blog/2009/09/30/alertcheck-grows-up/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>alertCheck on Mozilla Addons</title>
		<link>http://mikeconley.ca/blog/2009/08/22/alertcheck-on-mozilla-addons/</link>
		<comments>http://mikeconley.ca/blog/2009/08/22/alertcheck-on-mozilla-addons/#comments</comments>
		<pubDate>Sat, 22 Aug 2009 17:15:28 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[alertCheck]]></category>
		<category><![CDATA[Firefox Extensions]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[alert]]></category>
		<category><![CDATA[dialog]]></category>
		<category><![CDATA[extension]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[modal]]></category>
		<category><![CDATA[override]]></category>
		<category><![CDATA[suppress]]></category>

		<guid isPermaLink="false">http://mikeconley.ca/blog/?p=662</guid>
		<description><![CDATA[Remember alertCheck &#8211; that Firefox Extension I wrote a while back, that helped suppress annoying popups? I finally decided to post it on Mozilla Addons.  Now compatible with Firefox 3.5.*. Here you go.]]></description>
			<content:encoded><![CDATA[<p>Remember alertCheck &#8211; that Firefox Extension I wrote a while back, that helped suppress annoying popups?</p>
<p>I finally decided to post it on Mozilla Addons.  Now compatible with Firefox 3.5.*.</p>
<p><a href="https://addons.mozilla.org/en-US/firefox/addon/13176">Here you go.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://mikeconley.ca/blog/2009/08/22/alertcheck-on-mozilla-addons/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>wordCount.xpi &#8211; Part 1</title>
		<link>http://mikeconley.ca/blog/2009/05/07/wordcountxpi-part-1/</link>
		<comments>http://mikeconley.ca/blog/2009/05/07/wordcountxpi-part-1/#comments</comments>
		<pubDate>Thu, 07 May 2009 22:04:21 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[Computer Science]]></category>
		<category><![CDATA[Firefox Extensions]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[mozilla]]></category>
		<category><![CDATA[OpenOffice]]></category>
		<category><![CDATA[TreeWalker]]></category>
		<category><![CDATA[wc]]></category>
		<category><![CDATA[word count]]></category>
		<category><![CDATA[word counting]]></category>
		<category><![CDATA[wordCount]]></category>
		<category><![CDATA[writer]]></category>

		<guid isPermaLink="false">http://mikeconley.ca/blog/?p=407</guid>
		<description><![CDATA[So, if you recall, I was asked to write a Firefox extension that would do word counting on websites. Originally, when I started this project, I set a goal for myself:  I copied the text from Project Gutenberg&#8217;s First Folio version of Shakespeare&#8217;s Hamlet into OpenOffice Writer, recorded the word/line/character count statistics, and set that [...]]]></description>
			<content:encoded><![CDATA[<p>So, if you recall, I was asked to write a Firefox extension that would do word counting on websites.</p>
<p>Originally, when I started this project, I set a goal for myself:  I copied the text from <a href="http://www.gutenberg.org/dirs/etext00/0ws2610.txt">Project Gutenberg&#8217;s First Folio version of Shakespeare&#8217;s Hamlet </a>into OpenOffice Writer, recorded the word/line/character count statistics, and set that as my projected goal for my first iteration of my extension.</p>
<p>But there&#8217;s a problem with this approach:  I&#8217;m supposed to be copying the behaviour of Unix&#8217;s wc, not OpenOffice Writer&#8217;s word count.  Normally, this wouldn&#8217;t be a problem &#8211; a word count is a word count, a line count is a line count, and Writer should pump out the same numbers as wc.</p>
<p>Not so.</p>
<p>In my last post, I wrote:</p>
<blockquote><p>According to OpenOffice Writer, this text has 32230 words, 173543 characters, and 4257 lines.</p></blockquote>
<p>However, upon passing the same text (saved in the textfile &#8220;count.txt&#8221;) through wc, I got the following output:</p>
<blockquote><p>5302  32230 178845 count.txt</p></blockquote>
<p>Writer and wc agree on the number of words, but disagree on the number of lines &#8211; 5302 (wc) vs 4257 (Writer).  It&#8217;s a disagreement of about a thousand lines.</p>
<p>Brutal.</p>
<p>Anyhow, I&#8217;m going to focus on wc&#8217;s approach to line counting &#8211; simply returning the number of newline characters in the file.</p>
<p>And guess what&#8230;it works.  For Hamlet, my extension pumps out:</p>
<blockquote><p>Document statistics:</p>
<p>Word Count:  32230<br />
Line Count:  5302<br />
Character Count:  178845<br />
Character Count (no spaces):  142368</p></blockquote>
<p>Nice.</p>
<p>Hamlet&#8217;s just the simple case though.  There are plenty of other cases to consider, but this is a start.</p>
<p>Anyhow, <a href="http://www.mikeconley.ca/Firefox_Extensions/wordCount/wordCount.xpi">download here</a>.</p>
<p>In this version, I&#8217;m using <a href="https://developer.mozilla.org/En/DOM/TreeWalker">Mozilla&#8217;s TreeWalker implementation</a> to stitch together the page text.  So far it seems to be working alright, but if it somehow ends up falling through, I might end up using something like <a href="http://www.friendpaste.com/29sHyVu1J3iljnGks30yY3">Andrew Trusty&#8217;s code</a> with the jQuery library to do the text stitching.</p>
<p>So there it is.  Maybe I&#8217;ll keep working on this, pretty it up a bit, etc.  However, work starts on Monday, and that&#8217;ll probably take up most of my technical attention.</p>
<p>We&#8217;ll see though.</p>
]]></content:encoded>
			<wfw:commentRss>http://mikeconley.ca/blog/2009/05/07/wordcountxpi-part-1/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>For my next trick&#8230;</title>
		<link>http://mikeconley.ca/blog/2009/05/05/for-my-next-trick/</link>
		<comments>http://mikeconley.ca/blog/2009/05/05/for-my-next-trick/#comments</comments>
		<pubDate>Tue, 05 May 2009 22:28:32 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[Computer Science]]></category>
		<category><![CDATA[Firefox Extensions]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[extension]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[mozilla]]></category>
		<category><![CDATA[wc]]></category>

		<guid isPermaLink="false">http://mikeconley.ca/blog/?p=404</guid>
		<description><![CDATA[It didn&#8217;t take long for another Firefox extension idea to come along. Prof. Greg Wilson recently sent me an email, saying the following: I&#8217;d like a Firefox plugin that does &#8216;wc&#8217;, i.e., counts characters, words, and lines on the current web page, and displays the results in the status bar. Cool, I thought.  No problem.  [...]]]></description>
			<content:encoded><![CDATA[<p>It didn&#8217;t take long for another Firefox extension idea to come along.</p>
<p>Prof. Greg Wilson recently sent me an email, saying the following:</p>
<blockquote><p>I&#8217;d like a Firefox plugin that does &#8216;wc&#8217;, i.e., counts characters, words,  and lines on the current web page, and displays the results in the status  bar.</p></blockquote>
<p>Cool, I thought.  No problem.  That doesn&#8217;t sound too hard.</p>
<p>But I&#8217;ve been mulling and chewing this around in my head, and it&#8217;s actually a harder problem than it first sounds.</p>
<p>&#8220;<a href="http://en.wikipedia.org/wiki/Wc_(Unix)">wc</a>&#8220;, short for word-count, is a small, simple, yet extraordinarily useful Unix utility that reads in some file, and spits out the number of words, characters, and lines for that file.</p>
<p>So what&#8217;s the problem?  What&#8217;s so hard about coding something like this for web pages?</p>
<p>Well, for starters, users of this proposed extension are probably only interested in the visible, readable text on a web page.  That means filtering out all of the HTML tags, all of the JavaScript, etc.  Also, many modern web pages make use of IFRAME&#8217;s, hidden DIV&#8217;s, etc.  Not to mention, most browsers do automatic word-wrapping, which could throw off the &#8220;line&#8221; counting.  How should I treat these cases?</p>
<p>I certainly don&#8217;t think this is an impossible task, just harder than it first sounded.</p>
<p>So here&#8217;s what I&#8217;m going to do:</p>
<p>First, I&#8217;m going to take care of the base case.  I&#8217;m going to take care of the case where users are viewing a page of all text, with almost zero HTML.</p>
<p>My test page will be an &#8220;etext&#8221; copy of <a href="http://www.gutenberg.org/dirs/etext00/0ws2610.txt">Shakespeare&#8217;s Hamlet (first folio)</a>, hosted by Project Gutenberg.</p>
<p>According to OpenOffice Writer, this text has 32230 words, 173543 characters, and 4257 lines.</p>
<p>So that&#8217;s my target.  I&#8217;m going to create an extension that sits as a button on the status bar.  When the button is clicked, an alert will pop up with the statistics.  If all goes well, the numbers will match.</p>
<p>Sure, it&#8217;s not the most elegant interface, but it&#8217;ll do for now.</p>
<p>I&#8217;ll post more as it comes.</p>
]]></content:encoded>
			<wfw:commentRss>http://mikeconley.ca/blog/2009/05/05/for-my-next-trick/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Overriding Firefox’s Window.Alert &#8211; Part 4</title>
		<link>http://mikeconley.ca/blog/2009/05/03/overriding-firefox%e2%80%99s-windowalert-part-4/</link>
		<comments>http://mikeconley.ca/blog/2009/05/03/overriding-firefox%e2%80%99s-windowalert-part-4/#comments</comments>
		<pubDate>Sun, 03 May 2009 21:42:12 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[alertCheck]]></category>
		<category><![CDATA[Computer Science]]></category>
		<category><![CDATA[Firefox Extensions]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[alert]]></category>
		<category><![CDATA[content.alert]]></category>
		<category><![CDATA[download]]></category>
		<category><![CDATA[extension]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[mozilla]]></category>
		<category><![CDATA[override]]></category>
		<category><![CDATA[window.alert]]></category>

		<guid isPermaLink="false">http://mikeconley.ca/blog/?p=392</guid>
		<description><![CDATA[So, I think I&#8217;m more or less done the extension. Someday, when I&#8217;ve got more extension development experience under my belt, I&#8217;ll probably come back to this and fix it up.  Until then, this will have to do. Click here to download. If you&#8217;re interested in looking at the source, just change the file extension [...]]]></description>
			<content:encoded><![CDATA[<p>So, I think I&#8217;m more or less done the extension.</p>
<p>Someday, when I&#8217;ve got more extension development experience under my belt, I&#8217;ll probably come back to this and fix it up.  Until then, this will have to do.</p>
<p><a href="https://addons.mozilla.org/en-US/firefox/addon/13176">Click here to download.</a></p>
<p>If you&#8217;re interested in looking at the source, just change the file extension from &#8220;.xpi&#8221; to &#8220;.zip&#8221;, and decompress.  It&#8217;s all there.</p>
<p>There&#8217;s no license on this thing, no GPL, MIT, nothing.  Use it however you want.  <strong>If you find it useful though, I&#8217;d love to hear from you</strong> &#8211; send me email, post a comment, Facebook, Twitter, whichever.</p>
<p>Whew.  I think I&#8217;m going to reward myself with some orange sherbet.  Om nom nom&#8230;</p>
<p>Here&#8217;s a really annoying website to test the extension with.  <strong>I really don&#8217;t recommend that you visit it without my extension installed</strong>.</p>
<p>The window hops around a bit, so just double click on the location bar, and type in something like &#8220;http://www.google.ca&#8221;.  This will start up the flood of alerts, and (hopefully) you&#8217;ll be able to suppress them after the first one hits.</p>
<p><a href="http://www.bringvictory.com/">Here&#8217;s the site.  Visit at your own risk.</a></p>
<p><strong>UPDATE:</strong></p>
<p>I&#8217;ve <a href="https://addons.mozilla.org/en-US/firefox/addon/13176">moved the extension to Mozilla Addons</a>, and added Firefox 3.5 compatibility.</p>
<p>I&#8217;ve updated alertCheck.xpi so that it&#8217;ll play nice with Firefox 3.0b5, and hopefully Firefox 3.1.*.  Let me know if there are any behaviour foulups, and I&#8217;ll do my best to fix them.</p>
]]></content:encoded>
			<wfw:commentRss>http://mikeconley.ca/blog/2009/05/03/overriding-firefox%e2%80%99s-windowalert-part-4/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>Overriding Firefox’s Window.Alert &#8211; Part 3</title>
		<link>http://mikeconley.ca/blog/2009/05/03/overriding-firefox%e2%80%99s-windowalert-part-3/</link>
		<comments>http://mikeconley.ca/blog/2009/05/03/overriding-firefox%e2%80%99s-windowalert-part-3/#comments</comments>
		<pubDate>Sun, 03 May 2009 07:14:17 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[alertCheck]]></category>
		<category><![CDATA[Computer Science]]></category>
		<category><![CDATA[Firefox Extensions]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[alert]]></category>
		<category><![CDATA[content.alert]]></category>
		<category><![CDATA[contentWindow]]></category>
		<category><![CDATA[DOMContentLoaded]]></category>
		<category><![CDATA[DOMWillOpenModalDialog]]></category>
		<category><![CDATA[DoS]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[mozilla]]></category>
		<category><![CDATA[override]]></category>
		<category><![CDATA[window.alert]]></category>
		<category><![CDATA[wrappedJSObject]]></category>

		<guid isPermaLink="false">http://mikeconley.ca/blog/?p=387</guid>
		<description><![CDATA[Wow.  I think I got it.  I&#8217;ve got a Firefox plugin that can suppress all alert() dialogs on a page if the user checks a &#8220;suppress&#8221; box on the second alert() dialog. The trick, was not to rely on the DOMContentLoaded event to fire to do the override.  Instead, I used the DOMWillOpenModalDialog to detect [...]]]></description>
			<content:encoded><![CDATA[<p>Wow.  I think I got it.  I&#8217;ve got a Firefox plugin that can suppress all alert() dialogs on a page if the user checks a &#8220;suppress&#8221; box on the second alert() dialog.</p>
<p>The trick, was not to rely on the DOMContentLoaded event to fire to do the override.  Instead, I used the DOMWillOpenModalDialog to detect the first alert().  After detection, I overrode with an alertCheck which asked the user whether or not to &#8220;suppress more dialogs&#8221;.  If the user answers in the affirmative, alert() is simply overwritten with an empty function.</p>
<p>Piece of cake.</p>
<p>A couple of issues though&#8230;</p>
<h2>Security</h2>
<p>In order to override the alert() function, I have to write to document.getElementById(&#8216;content&#8217;).contentWindow.wrappedJSObject.alert.</p>
<p>Remember how I mentioned the <em>distance</em> between the Extension JavaScript, and the inline content JavaScript?  I said it felt like a security layer.</p>
<p>I was totally right.</p>
<p><a href="https://developer.mozilla.org/En/Working_with_windows_in_chrome_code#Accessing_content_documents">Check this out.</a> I&#8217;ll quote:</p>
<blockquote><p>You should be aware of <a rel="internal" href="https://developer.mozilla.org/en/XPCNativeWrapper">XPCNativeWrappers</a> when working with <a rel="internal" href="https://developer.mozilla.org/en/XPCNativeWrapper#What_is_a_trusted_window.3F">untrusted content</a>. With XPCNativeWrappers turned on (which is the default in Firefox 1.5+), your extension can safely access the DOM of the content document, but not the content JavaScript. Bypassing XPCNativeWrapper to work with content JavaScript directly can lead to security problems.</p></blockquote>
<p>Hrmph.  So I seem to be violating some security rules here.  So maybe my approach isn&#8217;t the greatest idea.  &#8220;Mook&#8221; from irc.mozilla.net #extdev suggested looking into commonDialog.xul&#8230;but I can&#8217;t seem to wrap my head around that just yet.</p>
<h2>Imperfections</h2>
<p>Not sure why yet, but while I can suppress dialog floods like this:</p>
<pre>for (i = 0; i &lt; 10; ++i) {
  alert(i);
}</pre>
<p>It seems to fail on this:</p>
<pre>for (i = 0; i &lt; 10; ++i) {
  alert(i);
  confirm(i);
}</pre>
<p>For some reason, regardless of whether or not I choose to suppress the dialogs, they just keep coming.  It works fine when I swap out the confirm() for a second alert().  Not exactly sure why.  Yet.</p>
<p>Ok, so I&#8217;m going to clean the code up, and post it soon.  I&#8217;ll also post a link to a real, brutally annoying website where you can test the alertCheck extension.  Just give me a bit.</p>
]]></content:encoded>
			<wfw:commentRss>http://mikeconley.ca/blog/2009/05/03/overriding-firefox%e2%80%99s-windowalert-part-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

