<?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>Softcore software development &#187; addons</title>
	<atom:link href="http://tea.cesaroliveira.net/archives/category/addons/feed" rel="self" type="application/rss+xml" />
	<link>http://tea.cesaroliveira.net</link>
	<description>It&#039;s all about the cycles</description>
	<lastBuildDate>Tue, 24 Jan 2012 04:31:50 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Firefox Synchronisation Extension</title>
		<link>http://tea.cesaroliveira.net/archives/262</link>
		<comments>http://tea.cesaroliveira.net/archives/262#comments</comments>
		<pubDate>Sat, 04 Dec 2010 00:12:57 +0000</pubDate>
		<dc:creator>Cesar</dc:creator>
				<category><![CDATA[addons]]></category>
		<category><![CDATA[UX]]></category>

		<guid isPermaLink="false">http://tea.cesaroliveira.net/?p=262</guid>
		<description><![CDATA[Found this as an installed add-on in my Firefox browser. It didn&#8217;t seem related to Firefox sync/weave, so after some tracking it turns out to be a Nokia extension. It is one binary component. I don&#8217;t like the name Nokia chose. It gives no indication that it comes from them, and it gives the impression [...]]]></description>
			<content:encoded><![CDATA[<p>Found this as an installed add-on in my Firefox browser. It didn&#8217;t seem related to Firefox sync/weave, so after some tracking it turns out to be a Nokia extension. It is one binary component.</p>
<p>I don&#8217;t like the name Nokia chose. It gives no indication that it comes from them, and it gives the impression that it comes directly from Firefox.</p>
]]></content:encoded>
			<wfw:commentRss>http://tea.cesaroliveira.net/archives/262/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Firefox extension logging</title>
		<link>http://tea.cesaroliveira.net/archives/238</link>
		<comments>http://tea.cesaroliveira.net/archives/238#comments</comments>
		<pubDate>Tue, 26 Oct 2010 19:36:45 +0000</pubDate>
		<dc:creator>Cesar</dc:creator>
				<category><![CDATA[addons]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[debug]]></category>
		<category><![CDATA[extension]]></category>
		<category><![CDATA[logging]]></category>

		<guid isPermaLink="false">http://tea.cesaroliveira.net/?p=238</guid>
		<description><![CDATA[Last week, I was tasked at work to create a quick prototype extension. This machine had a few other extensions, including the very verbose SmartSwipe extension. SmartSwipe extension logs almost everything to the error console as messages. Which in turns makes it a pretty bad choice for any other extension who wants to use the [...]]]></description>
			<content:encoded><![CDATA[<p>Last week, I was tasked at work to create a quick prototype extension. This machine had a few other extensions, including the very verbose SmartSwipe extension. SmartSwipe extension logs almost everything to the error console as messages. Which in turns makes it a pretty bad choice for any other extension who wants to use the error console as a logging service (incidentally, I am the main developer of the SmartSwipe extension, so this is entirely my fault).</p>
<p>Despite Firefox extensions growing more complex, there are two areas of extension development that are still a pain to deal with: debugging and logging.</p>
<p>What pains me is that extensions have a pretty crappy choice of methods to use for logging purposes. There is <a href="https://developer.mozilla.org/en/DOM/window.dump" onclick="pageTracker._trackPageview('/outgoing/developer.mozilla.org/en/DOM/window.dump?referer=');">dump()</a>, <a href="https://developer.mozilla.org/en/Components.utils.reportError" onclick="pageTracker._trackPageview('/outgoing/developer.mozilla.org/en/Components.utils.reportError?referer=');">Components.utils.reportError()</a>, FUEL’s <a href="https://developer.mozilla.org/en/Toolkit_API/extIConsole#log.28.29" onclick="pageTracker._trackPageview('/outgoing/developer.mozilla.org/en/Toolkit_API/extIConsole_log.28.29?referer=');">Application.console.log()</a>, and maybe some others I am missing (ChromeBug is another possibility, but I haven&#8217;t used it). But these methods of logging don’t scale very well. If you have more than 1 extension using the same logging service, you introduce noise that can be difficult to sort through.</p>
<p>It striked me that there was nothing simple to capture and filter your logging information. Since this problem was annoying me, I decided to create an extension to deal with this.</p>
<h2>Introducing Debug Log</h2>
<p>The extension is uncreatively called Debug Log (unrelated to Jeremy Gillick&#8217;s <a href="https://addons.mozilla.org/en-US/firefox/addon/3983/" onclick="pageTracker._trackPageview('/outgoing/addons.mozilla.org/en-US/firefox/addon/3983/?referer=');">DebugLogger</a>). It shows a <a href="http://en.wikipedia.org/wiki/Event_Viewer" onclick="pageTracker._trackPageview('/outgoing/en.wikipedia.org/wiki/Event_Viewer?referer=');">Windows-style event viewer</a> with basic filtering. To use it is really easy. First I will show how it is used, and next how to use it when the Debug Log extension isn’t installed:</p>
<p><code>
<pre>
var log = {};
(function() {
        var modules = {};
        Components.utils.import("chrome://debuglog/content/DebugLog.jsm",
        modules);
        log = new modules.DebugLog("my_extension_slug_name");
        log.info("Hello")
        log.warn("Trimming to 8 characters. String : " + s);
        log.error("MyTerribleFunction", exception);
        log.assert(foo != null, "foo should never be null");
})();
</pre>
<p></code></p>
<p>Which results in the following:<br />
<img src="http://media.cesaroliveira.net/images/debuglog-example0.png" alt="screenshot"/></p>
<p>Assert is a bit different from typical assertion in other languages. It will not quit the application, nor would it throw an exception (unless you passed a wrong parameter to assert).</p>
<p>To use it properly, you must also account for times when DebugLog is not installed.<br />
<code>
<pre>
var logging = {};
(function() {
        try
        {
                var modules = {};
                Components.utils.import("chrome://debuglog/content/DebugLog.jsm",
                modules);
                logging = new modules.DebugLog("JavascriptPlusPlus");
        }
        catch (e)
        {
                logging.assert = logging.warn = logging.info = logging.error = function() {}
        }
})()
logging.info("Starting...");
</pre>
<p></code></p>
<p>The extension still has a lot of work to be done, but it&#8217;s useable now. So now is the time to release and it is available at <a href="https://addons.mozilla.org/en-US/firefox/addon/246799/" onclick="pageTracker._trackPageview('/outgoing/addons.mozilla.org/en-US/firefox/addon/246799/?referer=');">https://addons.mozilla.org/en-US/firefox/addon/246799/</a>. Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://tea.cesaroliveira.net/archives/238/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Reordering the tab key &#8211; tabcomplete</title>
		<link>http://tea.cesaroliveira.net/archives/220</link>
		<comments>http://tea.cesaroliveira.net/archives/220#comments</comments>
		<pubDate>Sun, 01 Aug 2010 02:04:06 +0000</pubDate>
		<dc:creator>Cesar</dc:creator>
				<category><![CDATA[addons]]></category>
		<category><![CDATA[extension]]></category>
		<category><![CDATA[hugs]]></category>
		<category><![CDATA[keyboard]]></category>
		<category><![CDATA[tab]]></category>
		<category><![CDATA[tabcomplete]]></category>

		<guid isPermaLink="false">http://tea.cesaroliveira.net/?p=220</guid>
		<description><![CDATA[I am in the process of creating a new Firefox add-on that will hopefully change a bit how we navigate some sites. Until now, keyboard navigation for the vast majority of sites has been simply unusable. Even though websites have a layout that can easily use a keyboard, it often relies on either remembering shortcuts [...]]]></description>
			<content:encoded><![CDATA[<p>I am in the process of creating a new Firefox add-on that will hopefully change a bit how we navigate some sites. Until now, keyboard navigation for the vast majority of sites has been simply unusable. Even though websites have a layout that can easily use a keyboard, it often relies on either remembering shortcuts or tabbing through. You are almost exclusively limited to a mouse when using a full-featured browser such as Firefox, Chrome, and IE.</p>
<p>Personally, I hate using the trackpad on my laptop. After extended use, the heat and the friction take a toll on my fingers. I have an external USB mouse, but that often becomes a bother as the laptop is moved around from one location to another. Yes, wireless mice, but again we&#8217;re not really fixing the problem.</p>
<p>For simple navigation, it&#8217;s almost a crime that I cannot tab between links and major components of a web site&#8217;s navigation.</p>
<p>The <a href="http://www.w3.org/TR/html401/interact/forms.html#adef-tabindex" onclick="pageTracker._trackPageview('/outgoing/www.w3.org/TR/html401/interact/forms.html_adef-tabindex?referer=');">tabindex</a> HTML attribute has gone largely unused when browsing the web. Perhaps for a myriad of reasons &#8211; it&#8217;s hard to re-order manually, and for many web developers it&#8217;s not worth the time or effort.</p>
<p>Even for everyday use, it becomes ridiculous how crappy it the tab key can be. Think about this:</p>
<ul>
<li>For a Google search result, the tab key must be hit <em>12 time</em>s before it focuses on your search text. Another 3 tab strikes before it takes you to the first result. Another <em>5 times or more to get to the second result</em> &#8211; not counting Google&#8217;s quick links.</li>
<li>For planet.mozilla.org, each tab key will go through every anchor link in each person&#8217;s blog post. Oh, and it takes 6 tab keystrokes to go to the first article.</li>
<li>For reddit, it can be a little better. If you just use tab, you&#8217;ll go through each &#8220;share&#8221; link first. Which is stupid. If you activate &#8220;jump to content&#8221; it will go through image->link->domain->usersubreddit->comments. Which is still a lot for one result.</li>
</ul>
<p>This is how I would order the tab key on a Google search result:<br />
<div id="attachment_221" class="wp-caption aligncenter" style="width: 286px"><a href="http://tea.cesaroliveira.net/wp-content/uploads/2010/07/google-taborder.png"><img src="http://tea.cesaroliveira.net/wp-content/uploads/2010/07/google-taborder-276x300.png" alt="Possible tab order on google" title="google-taborder" width="276" height="300" class="size-medium wp-image-221" /></a><p class="wp-caption-text">Possible tab order on google</p></div></p>
<p>I would probably use the top Google bar the least when doing a google search. Each time you hit tab, it will cycle through the search box, 1st result, 2nd result, etc. until you hit n-th result.</p>
<p>This would be great in an ideal world. A Firefox extension could do this, but for my purposes my extension does not do this. It doesn&#8217;t map the tab key. It instead uses the key right above it. Like tab, CTRL+` will cycle forward and SHIFT+~ will cycle backwards.</p>
<p>I call it <a href="https://addons.mozilla.org/firefox/addon/210516/" onclick="pageTracker._trackPageview('/outgoing/addons.mozilla.org/firefox/addon/210516/?referer=');">tabcomplete</a>. It&#8217;s not as pretty as <a href="http://azarask.in/projects/tabcandy/" onclick="pageTracker._trackPageview('/outgoing/azarask.in/projects/tabcandy/?referer=');">tabcandy</a>. I think a large part of my user-base wouldn&#8217;t be most users. Users seem content on using the mouse, and that&#8217;s fine. But for a guy who works in vim, this is a nice to have extension.</p>
]]></content:encoded>
			<wfw:commentRss>http://tea.cesaroliveira.net/archives/220/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Number of daily downloads slightly reduced on AMO</title>
		<link>http://tea.cesaroliveira.net/archives/103</link>
		<comments>http://tea.cesaroliveira.net/archives/103#comments</comments>
		<pubDate>Mon, 26 Oct 2009 05:01:04 +0000</pubDate>
		<dc:creator>Cesar</dc:creator>
				<category><![CDATA[addons]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[mozilla]]></category>

		<guid isPermaLink="false">http://tea.cesaroliveira.net/?p=103</guid>
		<description><![CDATA[This was originally written early September. The patch was live late September. And 4 weeks of results later, this post. My apologies if I mixed past and present tense The number of add-on downloads was always an interesting figure to me. Over several months, one of my add-ons was getting over 100 downloads a week [...]]]></description>
			<content:encoded><![CDATA[<p><strong>This was originally written early September. The patch was live late September. And 4 weeks of results later, this post. My apologies if I mixed past and present tense</strong></p>
<p>The number of add-on downloads was always an interesting figure to me. Over several months, one of my add-ons was getting over 100 downloads a week without any promotion. But my <acronym title="Active Daily Users">ADU</acronym> remains almost constant every week. It may increase by a few, but compared to the number of downloads, it only seemed like I got an abnormally low number of conversions. Less than 15% of users who downloaded my add-on turned into a ADU.</p>
<p>This didn&#8217;t seem right, so for 0.7 release of <a href="https://addons.mozilla.org/en-US/firefox/addon/11666" onclick="pageTracker._trackPageview('/outgoing/addons.mozilla.org/en-US/firefox/addon/11666?referer=');">Safe extension</a>, I added some code that sent me some info whenever someone uninstalled from the Add-ons Manager.</p>
<p>According to the add-ons dashboard, I had 78 ADU users for version 0.7 (submitted 2009-08-14. Averaged over a period of 1 week.).</p>
<p>How many downloads since it was uploaded? About 659 (I likely uploaded it late evening, so it might be less then that). So about 11% of the users that downloaded the extension didn&#8217;t uninstall it. But how many users chose to uninstall it using the Add-ons manager?</p>
<p>Ten.</p>
<p>So what of the other 500+ users? How did they uninstall my extension? I wondered whether web crawlers were downloading my extension. 500 seems like an awfully big number. Maybe a broken crawler? Well, actually, it turned out that <a href="https://addons.mozilla.org/robots.txt" onclick="pageTracker._trackPageview('/outgoing/addons.mozilla.org/robots.txt?referer=');">AMO&#8217;s robot.txt</a> did not exclude robots from downloading extensions at all. And how often a <a href="http://www.google.com/support/webmasters/bin/answer.py?hl=en&#038;answer=34439" onclick="pageTracker._trackPageview('/outgoing/www.google.com/support/webmasters/bin/answer.py?hl=en_038_answer=34439&amp;referer=');">crawler visits</a> is determined by the provider. Google cache takes a snapshot around once every week for me.</p>
<p>I realized that these numbers won&#8217;t be accurate because there are more ways to uninstall an add-on, including new profile or deleting the add-ons folder from the profile. But these seem like rare cases. Certainly not responsible for such a misleading number.</p>
<p>I <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=513483" onclick="pageTracker._trackPageview('/outgoing/bugzilla.mozilla.org/show_bug.cgi?id=513483&amp;referer=');">filed</a> and fixed a <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=512528" onclick="pageTracker._trackPageview('/outgoing/bugzilla.mozilla.org/show_bug.cgi?id=512528&amp;referer=');">earlier bug</a> to have robots.txt exclude crawlers from the /downloads/ path of each of our localized versions of AMO.</p>
<p>After 4 weeks, my stats have leveled off and the number of downloads have dropped by about 10 a day. My add-on downloads dropped from >10 to about 3 a day. This won&#8217;t be considerable to popular add-ons (<a href="https://addons.mozilla.org/en-US/statistics/addon/1865" onclick="pageTracker._trackPageview('/outgoing/addons.mozilla.org/en-US/statistics/addon/1865?referer=');">AdBlock Plus</a> shows no difference, they are still getting 80,000 downloads a day). Looking at the statistics on AMO, total downloads have dropped over 100,000 a day since the stuff went live last month. Good stuff.</p>
]]></content:encoded>
			<wfw:commentRss>http://tea.cesaroliveira.net/archives/103/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Statistical gathering for add-ons</title>
		<link>http://tea.cesaroliveira.net/archives/88</link>
		<comments>http://tea.cesaroliveira.net/archives/88#comments</comments>
		<pubDate>Mon, 10 Aug 2009 02:00:22 +0000</pubDate>
		<dc:creator>Cesar</dc:creator>
				<category><![CDATA[addons]]></category>
		<category><![CDATA[extension]]></category>
		<category><![CDATA[safe]]></category>
		<category><![CDATA[stats]]></category>

		<guid isPermaLink="false">http://tea.cesaroliveira.net/?p=88</guid>
		<description><![CDATA[Today I submitted version 0.7 of the safe add-on. This was not a version with additional features, but rather a version that collects stats from users who uninstall the add-on. I mainly did this because I wanted to know more about why only a small percentage of users who downloaded my extension continued on using [...]]]></description>
			<content:encoded><![CDATA[<p>Today I submitted version 0.7 of the <a href="https://addons.mozilla.org/en-US/firefox/addon/11666" onclick="pageTracker._trackPageview('/outgoing/addons.mozilla.org/en-US/firefox/addon/11666?referer=');">safe add-on</a>. This was not a version with additional features, but rather a version that collects stats from users who uninstall the add-on.</p>
<p>I mainly did this because I wanted to know more about why only a small percentage of users who downloaded my extension continued on using it. How long have they used the extension? What options have they enabled (if any)? Where are my users coming from? I stopped short of asking people to complete a feedback form, instead opting to just send data to my server. It&#8217;s relatively anonymous, except for the IP address which gets recorded.</p>
<p>Unfortunately, this doesn&#8217;t really give me useful statistics from people who stay with my add-on. Which is still useful. My best hope is that it&#8217;ll answer at least one of my questions that it was set out to answer.</p>
]]></content:encoded>
			<wfw:commentRss>http://tea.cesaroliveira.net/archives/88/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Successfully Getting your Addon Reviewed</title>
		<link>http://tea.cesaroliveira.net/archives/52</link>
		<comments>http://tea.cesaroliveira.net/archives/52#comments</comments>
		<pubDate>Tue, 13 Jan 2009 11:49:02 +0000</pubDate>
		<dc:creator>Cesar</dc:creator>
				<category><![CDATA[addons]]></category>
		<category><![CDATA[editor]]></category>
		<category><![CDATA[extension]]></category>
		<category><![CDATA[hugs]]></category>
		<category><![CDATA[mozilla]]></category>

		<guid isPermaLink="false">http://www.cesaroliveira.net/?p=51</guid>
		<description><![CDATA[As the addon review queue grows beyond 600 nominated and updated addons, it is more important than ever to make sure your extension passes review the first time around. Editors have a review guide, and a well hidden but publicly viewable set of policies. But here is a quick list of the most cited reasons [...]]]></description>
			<content:encoded><![CDATA[<p>As the addon review queue grows beyond 600 nominated and updated addons, it is more important than ever to make sure your extension passes review the first time around. Editors have a <a href="https://wiki.mozilla.org/Update:Editors/ReviewingGuide" onclick="pageTracker._trackPageview('/outgoing/wiki.mozilla.org/Update_Editors/ReviewingGuide?referer=');">review</a> guide, and a well hidden but publicly <a href="https://addons.mozilla.org/en-US/firefox/pages/policy" onclick="pageTracker._trackPageview('/outgoing/addons.mozilla.org/en-US/firefox/pages/policy?referer=');">viewable set of policies</a>. But here is a quick list of the most cited reasons for addon refusal :</p>
<ol>
<li>Addon should have at least 3 user reviews before being nominated. External reviews count too, but you have to mention them in your nomination message. Softpedia reviews do not count.</li>
<li>Wrap your <a href="http://blogger.ziesemer.com/2007/10/respecting-javascript-global-namespace.html" onclick="pageTracker._trackPageview('/outgoing/blogger.ziesemer.com/2007/10/respecting-javascript-global-namespace.html?referer=');">loose variables</a>. All objects, variables, and anything that your addon makes global should be wrapped to avoid conflicts with other addons.</li>
<li>Look at the error console. Is your extension throwing up javascript errors? Fix it. There are some <a href="https://developer.mozilla.org/en/Setting_up_extension_development_environment" onclick="pageTracker._trackPageview('/outgoing/developer.mozilla.org/en/Setting_up_extension_development_environment?referer=');">options</a> you can set in about:config to help you with this.</li>
<li>You break functionality in the host application (Firefox, Thunderbird, etc.).</li>
<li>Your extension doesn&#8217;t work properly, or showing unexpected results. This is what user reviews are expected to catch, but you really should get someone who wasn&#8217;t involved to test and report bugs.</li>
</ol>
<p>There are other less common things that can get you busted too. I&#8217;ll just list them here for completeness sake :</p>
<ol start="5">
<li>Including remote javascript/css or other files, anywhere. Include them in your xpi file instead.</li>
<li>CSS warnings on the error console if your submitting a theme.</li>
</ol>
<p>If you have any doubts, check the public policies page linked above.</p>
<p>And don&#8217;t ask when your extension will be reviewed in the comments. Because every answer will be the same : When someone gets around to it. It could be sooner if you&#8217;d help!</p>
]]></content:encoded>
			<wfw:commentRss>http://tea.cesaroliveira.net/archives/52/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>addParser.py</title>
		<link>http://tea.cesaroliveira.net/archives/44</link>
		<comments>http://tea.cesaroliveira.net/archives/44#comments</comments>
		<pubDate>Mon, 17 Nov 2008 08:34:56 +0000</pubDate>
		<dc:creator>Cesar</dc:creator>
				<category><![CDATA[addons]]></category>
		<category><![CDATA[editor]]></category>
		<category><![CDATA[tip]]></category>

		<guid isPermaLink="false">http://www.cesaroliveira.net/?p=44</guid>
		<description><![CDATA[Synopsis : python addonParser.py extension.xpi Description : A simple python script that lexically analysis Firefox extensions, trying to find any problems. Outputs any problems to the terminal. Requires : Python Image Library Notes : Writes any .jar files into the $PWD/temp/ directory. Breakdown of output : examing chrome/ (13) examing chrome/content/ (13) examing chrome/content/botOFF.png (13) [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Synopsis</strong> :<br />
python addonParser.py extension.xpi</p>
<p><strong>Description</strong> :<br />
A simple python script that lexically analysis Firefox extensions, trying to find any problems. Outputs any problems to the terminal.</p>
<p><strong>Requires</strong> :<br />
<a href="http://www.pythonware.com/products/pil/" onclick="pageTracker._trackPageview('/outgoing/www.pythonware.com/products/pil/?referer=');">Python Image Library</a></p>
<p><strong>Notes</strong> :<br />
Writes any .jar files into the $PWD/temp/ directory.</p>
<p><strong>Breakdown of output</strong> :<br />
<code>examing chrome/ (13)<br />
examing chrome/content/ (13)<br />
examing chrome/content/botOFF.png (13)<br />
examing chrome/content/botON.png (13)<br />
examing chrome/content/dowint.css (13)<br />
examing chrome/content/dowint.js (13)<br />
examing chrome/content/dowint.xul (13)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;WARNING: http://dowint.net/inc/js.php does not start with chrome:// and not a local file for file chrome/content/dowint.xul (5)<br />
examing chrome/content/logo.gif (13)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;WARNING: Image chrome/content/logo.gif does not match it's extension. Expected GIF, got PNG (2)<br />
examing chrome.manifest (13)<br />
examing install.rdf (13)</code></p>
<p>Numbers in parentheses at the end of line are just for debugging use only.<br />
Text in square parentheses is often the source of the problem (used when evaluating javascript files)</p>
<p><strong>Types</strong> :<br />
<em>Warning</em> – something is wrong or possibly needs some examining<br />
<em>Error</em> – I don&#8217;t know how to evaluate this (eg. files that I wasn&#8217;t expecting, or files that I don&#8217;t know how to properly evaluate)</p>
<p><strong>Quirks</strong> (some people call this bugs) :</p>
<ol>
<li>Sometimes it gives you information, but not enough context:<br />
WARNING: found XMLHttpRequest [var req = new XMLHttpRequest();] in file content/hrtoolbar.js (9)</li>
<li>Sometimes the output is extremely long because the js file was minified:<br />
WARNING: found XMLHttpRequest [var CC=Components.classes;var CI=Components.interfaces;var ... ]</li>
<li>False positives can be quite common :<br />
WARNING: found reference to outside source [@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");] in file skin/webwean.css. (8)<br />
(This is common false positive in CSS files. Though it has found a problem once)</li>
</ol>
<p><strong>Undecided Issues</strong> :</p>
<ul>
<li>What to do about .dtd and .properties (should anything be done for these files?)</li>
<li>Should XHR throw up a warning? It&#8217;s fairly common, and we&#8217;re really just worried about eval.</li>
</ul>
<p><strong>Checks and Errors</strong> :</p>
<table>
<tr>
<th>Error</th>
<th>Problem</th>
</tr>
<tr>
<td>1</td>
<td>Image file is not an image file</td>
</tr>
<tr>
<td>2</td>
<td>Image file extension does not match its type</td>
</tr>
<tr>
<td>3</td>
<td>XUL file is invalid XML</td>
</tr>
<tr>
<td>4</td>
<td>Inline JS</td>
</tr>
<tr>
<td>5</td>
<td>The src for a script tag was not a chrome:// url nor a local file</td>
</tr>
<tr>
<td>6</td>
<td>Invalid keyboard shortcuts (Macs require alt + another modifier)</td>
</tr>
<tr>
<td>7</td>
<td>iframe content type is not content</td>
</tr>
<tr>
<td>8</td>
<td>CSS file has an outside reference</td>
</tr>
<tr>
<td>9</td>
<td><acronym title="XMLHttpRequest">XHR</acronym> found</td>
</tr>
<tr>
<td>10</td>
<td>Javascript eval keyword found :p</td>
</tr>
<tr>
<td>11</td>
<td>Javascript <a href="https://developer.mozilla.org/En/MozIJSSubScriptLoader" onclick="pageTracker._trackPageview('/outgoing/developer.mozilla.org/En/MozIJSSubScriptLoader?referer=');">loadSubscript</a> found</td>
</tr>
<tr>
<td>12</td>
<td>Javascript new Function()</td>
</tr>
<tr>
<td>13</td>
<td>Log message</td>
</tr>
<tr>
<td>14</td>
<td><acronym title="Revision Control System">RCS</acronym> directory found. Could be sensitive to the author.</td>
</tr>
<tr>
<td>15</td>
<td>A binary component has been found</td>
</tr>
</table>
<p><strong>File</strong> :<br />
Currently available <a href="/files/2008-11-16/addonParser.py">here</a>. Will upload repository later.</p>
<p>Please be advised that this tool is extremely stupid, and not a substitute for careful reviews <img src='http://tea.cesaroliveira.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://tea.cesaroliveira.net/archives/44/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New Editor tool finally landed on AMO</title>
		<link>http://tea.cesaroliveira.net/archives/41</link>
		<comments>http://tea.cesaroliveira.net/archives/41#comments</comments>
		<pubDate>Fri, 10 Oct 2008 02:56:55 +0000</pubDate>
		<dc:creator>Cesar</dc:creator>
				<category><![CDATA[addons]]></category>
		<category><![CDATA[editor]]></category>
		<category><![CDATA[mozilla]]></category>
		<category><![CDATA[seneca]]></category>

		<guid isPermaLink="false">http://www.cesaroliveira.net/?p=41</guid>
		<description><![CDATA[I made a post several months ago about an diffing zippy files on the web. While that stuff landed, it was difficult to use because I deferred actually showing what files changed to a later date. oops Well, that made it nearly useless, because it was less effort to download each xpi file and do [...]]]></description>
			<content:encoded><![CDATA[<p>I made a post several months ago about an <a href="http://www.cesaroliveira.net/tea/archives/26" onclick="pageTracker._trackPageview('/outgoing/www.cesaroliveira.net/tea/archives/26?referer=');">diffing zippy files</a> on the web. While that stuff landed, it was difficult to use because I deferred actually <em>showing what files changed</em> to a later date. <a href="http://failblog.org/" onclick="pageTracker._trackPageview('/outgoing/failblog.org/?referer=');">oops</a></p>
<p>Well, that made it nearly useless, because it was less effort to download each xpi file and do a diff locally.</p>
<p>Well, I&#8217;m glad to say that I&#8217;ve right a worlds wrong. Some stuff I was working on finally landed recently (can&#8217;t remember when. But it wasn&#8217;t working two days ago. So somewhere between Monday and today). So you may notice a few changes.</p>
<p>The first being the side panel that shows all the files. Any files that were modified appear italicized. Which is a bit subtle, but is the only indication I could give that wouldn&#8217;t make it stick out like a bad rash, or a <a href="http://www.autocarparts.com/images/products/Honda/honda_element.jpg" onclick="pageTracker._trackPageview('/outgoing/www.autocarparts.com/images/products/Honda/honda_element.jpg?referer=');">honda element</a>. Suggestions welcome.</p>
<div style="text-align:center;"><img src="/files/2008-10-09/side-panel2.jpg" alt="side panel" /><br />Side Panel</div>
<p>So this pretty much completes what was started. Only some minor improvements were made since the last post. Including a wikipedia colour style diff :</p>
<div style="text-align:center;"><img src="/files/2008-10-09/fullscreen.jpg" alt="full screen image of the xpi diff"/><br />Full screen view</div>
<p>I hope that this will be useful to AMO editors and help speed up the reviews. Which is in much better shape than they were two months ago.</p>
]]></content:encoded>
			<wfw:commentRss>http://tea.cesaroliveira.net/archives/41/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Not even bytecode can save me now&#8230;</title>
		<link>http://tea.cesaroliveira.net/archives/35</link>
		<comments>http://tea.cesaroliveira.net/archives/35#comments</comments>
		<pubDate>Tue, 16 Sep 2008 07:57:18 +0000</pubDate>
		<dc:creator>Cesar</dc:creator>
				<category><![CDATA[addons]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[editor]]></category>
		<category><![CDATA[seneca]]></category>

		<guid isPermaLink="false">http://www.cesaroliveira.net/?p=35</guid>
		<description><![CDATA[I&#8217;ve been spending a few days on trying to develop a few tools for editors to use to quickly reject addons for obvious defects, such as loading remote scripts. But I wanted to get deeper into the javascript stuff mainly because it&#8217;s a) it&#8217;s harder and b) it&#8217;s where the real problems lie. But as [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been spending a few days on trying to develop a few tools for editors to use to quickly reject addons for obvious defects, such as loading remote scripts. But I wanted to get deeper into the javascript stuff mainly because it&#8217;s a) it&#8217;s harder and b) it&#8217;s where the real problems lie.</p>
<p>But as anyone can tell you, it&#8217;s not an easy task (going towards damn near impossible). Firstly, you can&#8217;t really use a lexical parser. Well, you can, but it won&#8217;t be dependable. Let&#8217;s take an example out of the Reviewer&#8217;s guide :</p>
<p><code>document["crea" + "teElement"]("s" + "c" + "r" + ["i", "p", "t"].join(""));</code></p>
<p>Which is sneaky way of creating a script element, though I question the competence of someone who will use this as their main line of attack (it&#8217;s practically spelled out for you). But taking this as a use case, and ignoring the fact that they can use document[cheese] instead, I wondering if parsing the javascript would make figuring this stuff out any better.</p>
<p>Happily, I have spidermonkey and a <a href="http://developer.mozilla.org/en/Introduction_to_the_JavaScript_shell" onclick="pageTracker._trackPageview('/outgoing/developer.mozilla.org/en/Introduction_to_the_JavaScript_shell?referer=');">js shell</a> to do any parsing I wish. But I found out some cool things that you can do in the shell, such as looking at the bytecode for an entire function using the dis() command.</p>
<p>This was interesting. Certainly, there are some optimizations you can do for :<br />
<code>document["crea" + "teElement"]("s" + "c" + "r" + ["i", "p", "t"].join("")); </code><br />
I would be shocked if it didn&#8217;t end up spelling out :<br />
<code>document["createElement"]("script"); </code></p>
<p>I had a few hurdles to overcome. Firstly, document is not defined in the javascript shell. Thinking it was defined in the xpcshell (owww. I was misled by some apparently <a href="http://mxr.mozilla.org/mozilla-central/search?find=%2Fjs%2Fsrc%2Fxpconnect%2Ftests%2F&amp;string=document" onclick="pageTracker._trackPageview('/outgoing/mxr.mozilla.org/mozilla-central/search?find=_2Fjs_2Fsrc_2Fxpconnect_2Ftests_2F_amp_string=document&amp;referer=');">unused tests</a> and my general ignorance that xpcshell tests went into unit/ and not js/ directory) I went through the added trouble of coping dis() and related functions from <a href="http://mxr.mozilla.org/mozilla-central/source/js/src/js.cpp#1373" onclick="pageTracker._trackPageview('/outgoing/mxr.mozilla.org/mozilla-central/source/js/src/js.cpp_1373?referer=');">js.cpp</a> to xpcshell.cpp. Once I realized that document wasn&#8217;t defined, I made a document mock object just to see what the blasted bytecode would look like.</p>
<p>I was a little disappointed. This source:<br />
<!--start_raw--><code>
<pre>var document = {
createElement : function(s) {
print("damn");
}
};

function foo() {
document["crea" + "teElement"]("s" + "c" + "r" + ["i", "p", "t"].join(""));
}

dis(foo);</pre>
<p></code><!--end_raw--></p>
<p>Ended up being this bytecode :<br />
<!--start_raw--><br />
<code style="font-size:smaller;">
<pre>
00000:  name "document"
00003:  string "createElement"
00006:  callelem
00007:  string "s"
00010:  string "c"
00013:  add
00014:  string "r"
00017:  add
00018:  newinit 3
00020:  zero
00021:  string "i"
00024:  initelem
00025:  one
00026:  string "p"
00029:  initelem
00030:  int8 2
00032:  string "t"
00035:  initelem
00036:  endinit
00037:  callprop "join"
00040:  string ""
00043:  call 1
00046:  add
00047:  call 1
00050:  pop
00051:  stop

Source notes:
  0:     0 [   0] newline
  1:     6 [   6] pcbase   offset 6
  3:    37 [  31] xdelta
  4:    37 [   0] pcbase   offset 19
  6:    43 [   6] pcbase   offset 25
  8:    47 [   4] pcbase   offset 47</pre>
<p></code><!--end_raw--></p>
<p>So, almost. The document["createElement"] part was correct, but the .join() wasn&#8217;t optimized. Although I wasn&#8217;t overly estatic, I knew that this was just one (somewhat lame) use case in the countless of possible others.</p>
<p>This is making me rethink whether lexical tools <em>are</em> the way to go. While they don&#8217;t give you any definitive proof that there is a possible security hole, they can still be useful. For example, if you want to use XMLHttpRequest, then you have to call it at least once in your program (even if you say <code>var Widget = XMLHttpRequest</code>). And at least that can bring up warning flags, or at least give editors a place to look.</p>
<p>I don&#8217;t think any tool can completely replace a human being. But hopefully, tools will help make the review process easier because you can start looking at high-risk areas first rather than starting from a arbitrary point and not coming across something until 10 minutes later.</p>
]]></content:encoded>
			<wfw:commentRss>http://tea.cesaroliveira.net/archives/35/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>More user generated content &#8211; My Lists</title>
		<link>http://tea.cesaroliveira.net/archives/31</link>
		<comments>http://tea.cesaroliveira.net/archives/31#comments</comments>
		<pubDate>Thu, 07 Aug 2008 06:42:43 +0000</pubDate>
		<dc:creator>Cesar</dc:creator>
				<category><![CDATA[addons]]></category>
		<category><![CDATA[intern]]></category>
		<category><![CDATA[mozilla]]></category>

		<guid isPermaLink="false">http://www.cesaroliveira.net/?p=31</guid>
		<description><![CDATA[I&#8217;ve been sorta hiding this behind a mac that is currently behind a locked building in an office somewhere in Mountain View, but thought that now was a good time as any to demonstrate what I have been working on. The project is called My Lists. In a nutshell, it allows users to generate and [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been sorta hiding this behind a mac that is currently behind a locked building in an office somewhere in Mountain View, but thought that now was a good time as any to demonstrate what I have been working on.</p>
<p>The project is called My Lists. In a nutshell, it allows users to generate and publish a list of addons. For example, you may want to generate a list of the best web developers extensions you can find. So you include extensions such as the <a href="https://addons.mozilla.org/en-US/firefox/addon/7434" onclick="pageTracker._trackPageview('/outgoing/addons.mozilla.org/en-US/firefox/addon/7434?referer=');">Extension Developer&#8217;s extension</a>, and <a href="https://addons.mozilla.org/en-US/firefox/addon/1843" onclick="pageTracker._trackPageview('/outgoing/addons.mozilla.org/en-US/firefox/addon/1843?referer=');">Firebug</a>. You can then share this list with friends, or post a link to your website. Other users can then directly download these extensions from that page.</p>
<p>You can get a demonstration of what a list looks like at a <a href="http://remora.cesaroliveira.net/en-US/firefox/myLists/display/1" onclick="pageTracker._trackPageview('/outgoing/remora.cesaroliveira.net/en-US/firefox/myLists/display/1?referer=');">remora instance</a> I put up on this site. Of course, you need a username/password to generate your own list (and find the page that lets you do it <img src='http://tea.cesaroliveira.net/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> ).</p>
<p>The hope is that this list will be used with other websites, through a web service. I currently have a <a href="http://remora.cesaroliveira.net/en-US/firefox/myLists/post" onclick="pageTracker._trackPageview('/outgoing/remora.cesaroliveira.net/en-US/firefox/myLists/post?referer=');">service</a> that does that by reading XML from a post request.</p>
<p>None of this is really done. Everything is very dis-jointed. You can&#8217;t tell what lists a user created or who created a list. Still needs polish. But just wanted to get the project out there in the open.</p>
]]></content:encoded>
			<wfw:commentRss>http://tea.cesaroliveira.net/archives/31/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

