<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">
  <channel>
    <title>zpao.com | blog</title>
    <link>http://zpao.com</link>
    <webMaster>paul@zpao.com (Paul O’Shannessy)</webMaster>
    <pubDate>Mon, 09 Nov 2009 18:26:39 GMT</pubDate>
    <description>AWESOME</description>
    <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/zpao" type="application/rss+xml" /><feedburner:emailServiceId>zpao</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><feedburner:browserFriendly>This is an XML content feed. It is intended to be viewed in a newsreader or syndicated to another site, subject to copyright and fair use.</feedburner:browserFriendly><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><item>
      <title>Status Update: November 9, 2009</title>
      <link>http://zpao.com/articles/25-status_update_nov_09_2009</link>
      <description>&lt;p&gt;Not much exciting happened this past week. We had some out-of-towners (&lt;a href="http://beltzner.ca/mike"&gt;beltzner&lt;/a&gt;, &lt;a href="http://blog.johnath.com/"&gt;johnath&lt;/a&gt;, and &lt;a href="http://autonome.wordpress.com/"&gt;dietrich&lt;/a&gt;) down in the Mountain View office. It&amp;#8217;s good to see the boss face-to-face every once in a while. Otherwise it was business as usual.&lt;/p&gt;


	&lt;h2&gt;What I got done last week:&lt;/h2&gt;


	&lt;ul&gt;
	&lt;li&gt;&lt;strong&gt;&lt;a href="https://bugzilla.mozilla.org/show_bug.cgi?id=522545"&gt;Bug 522545&lt;/a&gt;:&lt;/strong&gt; Third time&amp;#8217;s the charm. I finally found an acceptable approach to solving the problem. The problem of&amp;#8230; &lt;span class="caps"&gt;ZOMBIE TABS&lt;/span&gt;. Interestingly, this bug is fallout from a different bug I worked on. Read the bug for full details.&lt;/li&gt;
		&lt;li&gt;&lt;strong&gt;&lt;a href="https://bugzilla.mozilla.org/show_bug.cgi?id=525635"&gt;Bug 525635&lt;/a&gt; &amp;#38; &lt;a href="https://bugzilla.mozilla.org/show_bug.cgi?id=521233"&gt;Bug 521233&lt;/a&gt;:&lt;/strong&gt; Both of these are needed to get Per Tab Network Prioritization into Firefox 3.6. Bug 525635 was about the test that was randomly timing out on Linux. It&amp;#8217;s using the test framework added in bug 521233 (waitforFocus in browser-chrome tests), which obviously is not quite right. &lt;a href="http://design-noir.de/log"&gt;Dão&lt;/a&gt; is continuing to try to find the right fix, but until then, I&amp;#8217;ve worked around the issue in a better way than I was. This should make it OK to land everything needed on branch.&lt;/li&gt;
	&lt;/ul&gt;


	&lt;h2&gt;What&amp;#8217;s happening this week:&lt;/h2&gt;


	&lt;ul&gt;
	&lt;li&gt;Finish bug 522545. Blockers come first. I already have a large portion of the work done &amp;#38; have a good start on tests, so this shouldn&amp;#8217;t be too much work.&lt;/li&gt;
		&lt;li&gt;Land Per Tab Network Prioritization on branch. Not too much involved here, but it has to happen.&lt;/li&gt;
		&lt;li&gt;Work on &lt;a href="https://bugzilla.mozilla.org/show_bug.cgi?id=526545"&gt;bug 526545&lt;/a&gt; (Crash reporter still can send wrong &lt;span class="caps"&gt;URL&lt;/span&gt; when crashing during pageload). This is another blocker. The partial solution should be pretty easy and actually dovetails nicely with the work I&amp;#8217;m doing for bug 522545. The full solution might be a bit harder, and might not be worth it.&lt;/li&gt;
	&lt;/ul&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/zpao?a=hh3c1Ea7sA8:H3y0bwaLwIU:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/zpao?i=hh3c1Ea7sA8:H3y0bwaLwIU:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/zpao?a=hh3c1Ea7sA8:H3y0bwaLwIU:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/zpao?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/zpao/~4/hh3c1Ea7sA8" height="1" width="1"/&gt;</description>
      <pubDate>Mon, 09 Nov 2009 18:26:39 GMT</pubDate>
      <guid>http://zpao.com/articles/25-status_update_nov_09_2009</guid>
      <author>paul@zpao.com (Paul O’Shannessy)</author>
      <category>mozilla</category>
      <category>firefox</category>
      <category>statusupdate</category>
    </item>
    <item>
      <title>Per Tab Network Prioritization Update</title>
      <link>http://zpao.com/articles/24-per_tab_network_prioritization_update</link>
      <description>&lt;p&gt;Progress on this was not as fast as I&amp;#8217;d hoped it would be. It got stalled behind some other work, going to the &lt;span class="caps"&gt;CMU&lt;/span&gt; job fair, &lt;a href="http://twitter.com/zpao/status/5076044119"&gt;I was poisoned&lt;/a&gt;, and I had to figure out how the focus tests work. But that&amp;#8217;s enough with the negativity, this is supposed to be good news.&lt;/p&gt;


	&lt;p&gt;I finally got all my ducks in row and &lt;a href="http://hg.mozilla.org/mozilla-central/rev/bbeaa4e518ee"&gt;landed the feature today&lt;/a&gt;! If you don&amp;#8217;t remember what the feature does (or never knew), read through &lt;a href="http://zpao.com/articles/22-per_tab_network_prioritization"&gt;my original article on it&lt;/a&gt;. While the underlying implementation changed a fair amount, the basic concept is still the same. The only change made is that we adjust the priority instead of just changing it to pre-determined values. By doing it this way, we won&amp;#8217;t interfere with an add-on that, for example, gave Gmail a super high network priority.&lt;/p&gt;


	&lt;p&gt;We&amp;#8217;ve talked about getting this into Firefox 3.6. It&amp;#8217;ll need to &amp;#8220;bake&amp;#8221; a little while on trunk, but it landed cleanly and doesn&amp;#8217;t have any compatibility issues, so it should be ok. Then again, &lt;acronym title="I Am Not A Driver"&gt;IANAD&lt;/acronym&gt;.&lt;/p&gt;


	&lt;p&gt;Going along with this, I&amp;#8217;ve updated the &lt;a href="https://addons.mozilla.org/en-US/firefox/addon/14138"&gt;mozNetworkPrioritizer extension&lt;/a&gt; to reflect the change in compatibility. It should no longer be used with Firefox 3.7a1pre (and beyond). It will interact poorly with the built-in functionality and could lead to some weird priorities. It won&amp;#8217;t actually break anything, but there&amp;#8217;s no need to use it. I&amp;#8217;ll release another update if/when this goes into Firefox 3.6.&lt;/p&gt;


	&lt;p&gt;And that&amp;#8217;s it. I&amp;#8217;ll post again about future landings. Otherwise, I&amp;#8217;m going to be working on some session restore blockers and starting another project soon.&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/zpao?a=QSdsjom3FLY:aJPJgiQFDD0:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/zpao?i=QSdsjom3FLY:aJPJgiQFDD0:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/zpao?a=QSdsjom3FLY:aJPJgiQFDD0:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/zpao?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/zpao/~4/QSdsjom3FLY" height="1" width="1"/&gt;</description>
      <pubDate>Sat, 31 Oct 2009 01:54:13 GMT</pubDate>
      <guid>http://zpao.com/articles/24-per_tab_network_prioritization_update</guid>
      <author>paul@zpao.com (Paul O’Shannessy)</author>
      <category>mozilla</category>
      <category>firefox</category>
      <category>statusupdate</category>
    </item>
    <item>
      <title>Status Update: September 25, 2009</title>
      <link>http://zpao.com/articles/23-status_update_sept_25_2009</link>
      <description>&lt;p&gt;I haven&amp;#8217;t updated on the blog recently, so here&amp;#8217;s the past 3 weeks all at once.&lt;/p&gt;


	&lt;p&gt;The week of September 7, I was working on a &lt;a href="https://bugzilla.mozilla.org/show_bug.cgi?id=514751"&gt;couple&lt;/a&gt; &lt;a href="https://bugzilla.mozilla.org/show_bug.cgi?id=497730"&gt;blockers&lt;/a&gt;.&lt;/p&gt;


	&lt;p&gt;The week of September 14, I was in Pittsburgh recruiting at the Carnegie Mellon &lt;acronym title="Technical Opportunities Conference"&gt;TOC&lt;/acronym&gt; (job fair). I also did some work on Per Tab Network Prioritization (&lt;a href="https://bugzilla.mozilla.org/show_bug.cgi?id=514490"&gt;bug 514490&lt;/a&gt;) and a password manager performance bug (&lt;a href="https://bugzilla.mozilla.org/show_bug.cgi?id=492197"&gt;bug 492197&lt;/a&gt;).&lt;/p&gt;


	&lt;p&gt;This past week I worked on a few different things. I finished the password manager bug (which I hadn&amp;#8217;t finished because of a non-syntax-error-syntax-error). While helping &lt;a href="http://www.hskupin.info/"&gt;Henrik&lt;/a&gt; as he was using the storage &lt;span class="caps"&gt;API&lt;/span&gt;, &lt;a href="http://shawnwilsher.com/"&gt;Shawn&lt;/a&gt; mentioned that one of the methods I used was deprecated (though never explicitly). So I filed &lt;a href="https://bugzilla.mozilla.org/show_bug.cgi?id=518434"&gt;the bugs&lt;/a&gt; and &lt;a href="http://hg.mozilla.org/mozilla-central/pushloghtml?changeset=5e6a413226d2"&gt;fixed the places&lt;/a&gt; that used the deprecated code (hint: use &lt;code&gt;executeStep()&lt;/code&gt; instead of &lt;code&gt;step()&lt;/code&gt; and don&amp;#8217;t use &lt;code&gt;mozIStorageStatementWrapper&lt;/code&gt;). Filing the bugs took longer than fixing them.&lt;/p&gt;


	&lt;p&gt;But all of that was unrelated to &amp;#8230;&lt;/p&gt;


	&lt;h2&gt;Per Tab Network Prioritization Status&lt;/h2&gt;


	&lt;h3&gt;Progress&lt;/h3&gt;


	&lt;ul&gt;
	&lt;li&gt;Made it a JS module. This was advice from &lt;a href="http://autonome.wordpress.com/"&gt;Dietrich&lt;/a&gt; to cut down on overhead. Since it was only being used from JS code, there was no need to use &lt;span class="caps"&gt;XPCOM&lt;/span&gt;.&lt;/li&gt;
		&lt;li&gt;Made it pref enabled. Right now it&amp;#8217;s &lt;code&gt;browser.networkprioritizer.enabled&lt;/code&gt; but that&amp;#8217;s easy to change.&lt;/li&gt;
		&lt;li&gt;Got a first pass look from Shawn, fixed a few things up.&lt;/li&gt;
	&lt;/ul&gt;


	&lt;h3&gt;Next Steps&lt;/h3&gt;


	&lt;ul&gt;
	&lt;li&gt;Reviews. It seems like Boris is the guy for the job. Still need a browser person. Gavin said sometime after Fennec stuff, Connor said 2 weeks. Dolske said &amp;#8220;soon&amp;#8221;, so he&amp;#8217;ll probably be the lucky guy, even if he isn&amp;#8217;t a peer.&lt;/li&gt;
	&lt;/ul&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/zpao?a=El6bWnG_dv4:s8i6K58rZ6w:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/zpao?i=El6bWnG_dv4:s8i6K58rZ6w:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/zpao?a=El6bWnG_dv4:s8i6K58rZ6w:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/zpao?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/zpao/~4/El6bWnG_dv4" height="1" width="1"/&gt;</description>
      <pubDate>Mon, 28 Sep 2009 06:11:49 GMT</pubDate>
      <guid>http://zpao.com/articles/23-status_update_sept_25_2009</guid>
      <author>paul@zpao.com (Paul O’Shannessy)</author>
      <category>mozilla</category>
      <category>firefox</category>
      <category>statusupdate</category>
    </item>
    <item>
      <title>Per Tab Network Prioritization</title>
      <link>http://zpao.com/articles/22-per_tab_network_prioritization</link>
      <description>&lt;p&gt;&lt;strong&gt;First!&lt;/strong&gt; (before you get distracted) &lt;a href="https://build.mozilla.org/tryserver-builds/poshannessy@mozilla.com-try-11a9e78a8cb5/"&gt;Try server builds!&lt;/a&gt; and &lt;a href="https://addons.mozilla.org/en-US/firefox/addon/14138/"&gt;the extension!&lt;/a&gt; (Firefox 3.5+)&lt;/p&gt;


	&lt;h2&gt;The Idea In Summary&lt;/h2&gt;


	&lt;p&gt;An idea that&amp;#8217;s likely been tossed around before has been brought to the forefront more recently by Firefox&amp;#8217;s newest designer &lt;a href="http://limi.net/"&gt;Alexander Limi&lt;/a&gt;, the idea of &lt;a href="https://wiki.mozilla.org/Firefox/Projects/Per_Tab_Network_Prioritization"&gt;per tab network prioritization&lt;/a&gt;. The premise of the idea is that what you&amp;#8217;re doing right now is more important that what you were doing 5 minutes ago. So to account for the relative importance, we should make what you&amp;#8217;re looking at right now load faster. This is really part of a grander scheme to improve perceived performance, but has been reduced to try to make some improvement achievable for Firefox 3.6.&lt;/p&gt;


	&lt;h2&gt;In More Detail&lt;/h2&gt;


	&lt;p&gt;For this pass, we divided tabs into level of importance (shown in descending order):&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;Selected Tab in a Focused Window&lt;/li&gt;
		&lt;li&gt;Background Tab in a Focused Window &amp;#38; Selected Tab in a Background Window&lt;/li&gt;
		&lt;li&gt;Background Tab in a Background Window&lt;/li&gt;
		&lt;li&gt;Any Tab in a Minimized Window&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;For the most part that makes sense, except for maybe one thing: the 2&lt;sup&gt;nd&lt;/sup&gt; level of importance has 2 items. We decided that (at least in general terms) background tabs in your current window and the focused tab in a background window should get the same level of network priority.&lt;/p&gt;


	&lt;p&gt;I then used this ranking to assign relative priorities. You can read more in the implementation section, but otherwise you can skip down to the progress report.&lt;/p&gt;


	&lt;h2&gt;Implementation&lt;/h2&gt;


	&lt;p&gt;My original plan was to do this all in browser/base/content (browser.js, tabbrowser.xml), but I ran into a roadblock of some sort. So I wrote it as an extension. After fixing an observer topic, I could do this with relative ease. I set my JS up much like the SessionStore component, observed a number of topics, and listened for a number of events. I was using an observer topic (xul-window-visible) which I was told I shouldn&amp;#8217;t use. When a tab was selected it&amp;#8217;s network priority gets bumped up and the previously selected tab gets dropped down. Same concept for windows.&lt;/p&gt;


	&lt;p&gt;I had to &lt;a href="https://bugzilla.mozilla.org/show_bug.cgi?id=511503"&gt;create some new events&lt;/a&gt; so that I could accurately know which window was focused. Then I brought it into our actual tree instead of living externally as an extension. I cleaned it up a bit, made sure I wasn&amp;#8217;t doing to too much, and then finally got around to &lt;a href="https://bugzilla.mozilla.org/show_bug.cgi?id=514490"&gt;filing the bug&lt;/a&gt;. I would go into further detail, but it&amp;#8217;s not super interesting. However, if you are interested, &lt;a href="https://bugzilla.mozilla.org/attachment.cgi?id=398441&amp;#38;action=diff#a/browser/components/networkprioritizer/src/nsNetworkPrioritizer.js_sec1"&gt;take a look at the code&lt;/a&gt;.&lt;/p&gt;


	&lt;p&gt;While there are some implementation details to improve upon (or just straight up change), it&amp;#8217;s doing what it was supposed to be doing. At this point I could move this back into browser/base/content but since it&amp;#8217;s working, there&amp;#8217;s no value in it (until we decide the project is a final go).&lt;/p&gt;


	&lt;h2&gt;Progress Report&lt;/h2&gt;


	&lt;p&gt;Initial results showed some improvement when loading large groups of tabs. It was most noticeable when loading many tabs from the same site (e.g. the default &lt;span class="caps"&gt;BBC&lt;/span&gt; livemarks). It was somewhat noticeable during a typical (for me) session restore. There was no difference during normal browsing.&lt;/p&gt;


	&lt;p&gt;But I&amp;#8217;m just one person. I know this is all the way at the bottom of this article, but &lt;strong&gt;&lt;span class="caps"&gt;PLEASE PLEASE PLEASE&lt;/span&gt; use &lt;a href="https://build.mozilla.org/tryserver-builds/poshannessy@mozilla.com-try-11a9e78a8cb5/"&gt;a try server build&lt;/a&gt;&lt;/strong&gt; (or &lt;strong&gt;&lt;a href="https://addons.mozilla.org/en-US/firefox/addon/14138/"&gt;the extension&lt;/a&gt;&lt;/strong&gt;) for a little bit and see if there&amp;#8217;s any noticeable difference. Even if it&amp;#8217;s just to load up that 500 tab session you&amp;#8217;ve been building up over the years.&lt;/p&gt;


	&lt;p&gt;&lt;strong&gt;Next Steps:&lt;/strong&gt; Get Feedback! If people use it and the results are positive, this will get more attention (tests, better implementation, checked in). If it turns out that we didn&amp;#8217;t quite achieve what we were hoping, then this will get shelved or used as part of another project.&lt;/p&gt;


	&lt;p&gt;So again: &lt;strong&gt;&lt;a href="https://build.mozilla.org/tryserver-builds/poshannessy@mozilla.com-try-11a9e78a8cb5/"&gt;try server builds&lt;/a&gt;&lt;/strong&gt; and &lt;strong&gt;&lt;a href="https://addons.mozilla.org/en-US/firefox/addon/14138/"&gt;the extension&lt;/a&gt;&lt;/strong&gt;!&lt;/p&gt;


	&lt;p&gt;&lt;em&gt;Updated September 4&lt;sup&gt;th&lt;/sup&gt; with links to the extension&lt;/em&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/zpao?a=uvs1SfmEkSI:dsrO67BXwx4:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/zpao?i=uvs1SfmEkSI:dsrO67BXwx4:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/zpao?a=uvs1SfmEkSI:dsrO67BXwx4:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/zpao?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/zpao/~4/uvs1SfmEkSI" height="1" width="1"/&gt;</description>
      <pubDate>Fri, 04 Sep 2009 23:53:19 GMT</pubDate>
      <guid>http://zpao.com/articles/22-per_tab_network_prioritization</guid>
      <author>paul@zpao.com (Paul O’Shannessy)</author>
      <category>mozilla</category>
      <category>firefox</category>
      <category>performance</category>
      <category>startup</category>
      <category>extension</category>
    </item>
    <item>
      <title>Oops, I Broke That</title>
      <link>http://zpao.com/articles/21-oops_i_broke_that</link>
      <description>&lt;p&gt;While making the &amp;#8220;Set as Desktop Background&amp;#8221; feature work on Windows CE, &lt;a href="https://bugzilla.mozilla.org/show_bug.cgi?id=512524"&gt;I accidentally broke it on other Windows systems&lt;/a&gt;. &lt;span class="caps"&gt;OOOOOPS&lt;/span&gt;.&lt;/p&gt;


	&lt;p&gt;This went unnoticed for ~3 weeks on the nightlies! It was even in Firefox 3.6 alpha 1. The fix was easy and was checked into trunk today. It&amp;#8217;ll be checked into the Firefox 3.6 branch soon.&lt;/p&gt;


	&lt;p&gt;I don&amp;#8217;t think mistakes like that are too uncommon, especially in areas where testing isn&amp;#8217;t automated. We probably have &lt;a href="https://litmus.mozilla.org/"&gt;Litmus tests&lt;/a&gt; for this so it would have been caught before a final release anyway, but still&amp;#8230;&lt;/p&gt;


	&lt;p&gt;This just goes to show how important testing is! (And yes, I &lt;a href="https://bugzilla.mozilla.org/show_bug.cgi?id=513349"&gt;filed a bug&lt;/a&gt; to add tests here)&lt;/p&gt;


	&lt;p&gt;This also goes to show just how little people use that feature :)&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/zpao?a=dvB9vNHQPc0:vKyVwidad6g:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/zpao?i=dvB9vNHQPc0:vKyVwidad6g:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/zpao?a=dvB9vNHQPc0:vKyVwidad6g:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/zpao?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/zpao/~4/dvB9vNHQPc0" height="1" width="1"/&gt;</description>
      <pubDate>Fri, 28 Aug 2009 23:04:56 GMT</pubDate>
      <guid>http://zpao.com/articles/21-oops_i_broke_that</guid>
      <author>paul@zpao.com (Paul O’Shannessy)</author>
      <category>mozilla</category>
      <category>firefox</category>
      <category>windows</category>
    </item>
    <item>
      <title>Better Session Restore Behavior</title>
      <link>http://zpao.com/articles/20-better_session_restore_behavior</link>
      <description>&lt;p&gt;Last week &lt;a href="https://bugzilla.mozilla.org/show_bug.cgi?id=354894"&gt;bug 354894&lt;/a&gt; &lt;a href="http://hg.mozilla.org/mozilla-central/rev/cd25ab8c2f30"&gt;landed&lt;/a&gt; to, surprisingly, little fanfare. It&amp;#8217;s a big deal though (more so on Windows &amp;#38; Linux).&lt;/p&gt;


	&lt;p&gt;Ever since Firefox introduced Session Restore, there has been one particularly annoying problem: if you close your last browser window but accidentally left a non-browser window open (eg. Downloads), then your session was fucked. End of story.&lt;/p&gt;


	&lt;p&gt;Well, no longer. Nils Maier (co-author of &lt;a href="http://www.downthemall.net/"&gt;DownThemAll&lt;/a&gt;) finally got fed up with this problem &amp;#38; decided to do something about it. This is the first &amp;#8220;major&amp;#8221; piece of code he&amp;#8217;s contributed, so a round of applause.&lt;/p&gt;


	&lt;p&gt;A super quick summary of the changes (assuming you have enabled session restore):&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;If you leave a non-browser window open, just close it. Your session will be saved (assuming you aren&amp;#8217;t on &lt;span class="caps"&gt;OS X&lt;/span&gt; anyway).&lt;/li&gt;
		&lt;li&gt;If you&amp;#8217;ve gotten down to that last non-browser window &amp;#38; realized your mistake, opening Firefox again (e.g. from the start menu) reopens your last closed window.&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;As a tangential comment, it&amp;#8217;s things like this that really make me proud to be a part of the Mozilla community. So much of our browser &amp;#38; platform comes from people like Nils who give their time freely to help make the web a better place.&lt;/p&gt;


	&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt; Minor changes based on email with Nils.&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/zpao?a=V9VaLhs0cic:i0yGIMi25iI:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/zpao?i=V9VaLhs0cic:i0yGIMi25iI:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/zpao?a=V9VaLhs0cic:i0yGIMi25iI:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/zpao?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/zpao/~4/V9VaLhs0cic" height="1" width="1"/&gt;</description>
      <pubDate>Fri, 07 Aug 2009 17:47:08 GMT</pubDate>
      <guid>http://zpao.com/articles/20-better_session_restore_behavior</guid>
      <author>paul@zpao.com (Paul O’Shannessy)</author>
      <category>mozilla</category>
      <category>sessionstore</category>
      <category>opensource</category>
    </item>
    <item>
      <title>Undo Close Window Has Landed!</title>
      <link>http://zpao.com/articles/19-undo_close_window_has_landed</link>
      <description>&lt;p&gt;I&amp;#8217;m happy to announce the landing of &lt;a href="https://bugzilla.mozilla.org/show_bug.cgi?id=394759"&gt;Undo Close Window&lt;/a&gt;. This adds a menu &amp;#38; keyboard shortcut for reopening your previously closed windows. By default we store 3 windows (though sometimes more due to special cases involving pop-up windows). I&amp;#8217;m not going to go into further implementation details (because really, I know you don&amp;#8217;t care), but if you&amp;#8217;re interested, you can take a look at the patches on the bug.&lt;/p&gt;


	&lt;h2&gt;A Little History&lt;/h2&gt;


	&lt;p&gt;Sometime before Firefox 2, there were APIs in place for handling recently closed windows. The only thing missing at that point was the front-end work to tie it together. But that never happened. Instead, since the code wasn&amp;#8217;t even being published for extensions to use, all that was happening is that we were eating memory for no good reason. So the &lt;a href="https://bugzilla.mozilla.org/show_bug.cgi?id=344642"&gt;code was taken out&lt;/a&gt; late in the 2.0 development cycle.&lt;/p&gt;


	&lt;p&gt;&lt;a href="https://bugzilla.mozilla.org/show_bug.cgi?id=360408"&gt;Bug 360408&lt;/a&gt; was added for Firefox 3, making it possible for extensions to be able to implement their own Undo Close Window if they wanted. The description of that bug was unclear though, since it didn&amp;#8217;t actually adding any APIs, it just made sure the data was kept around long enough to be saved by somebody else.&lt;/p&gt;


	&lt;p&gt;Along comes &lt;a href="https://bugzilla.mozilla.org/show_bug.cgi?id=394759"&gt;Bug 394759 &amp;#8211; Add undo close window feature&lt;/a&gt;, which sat untouched for almost a year. After I finished the &lt;a href="http://zpao.com/articles/10-passwordmgr_storage"&gt;primary project I worked on during my internship&lt;/a&gt;, I still had a week left, so I looked for bugs that I found interesting and allowed me to explore a new area of the code. I found this bug and wrote a &amp;#8220;working&amp;#8221; patch over a weekend. At that point I was really surprised that we didn&amp;#8217;t have this already. We&amp;#8217;ve had Undo Close Tab for a while, and this seemed like the sensible next step. In all honesty, somebody familiar with the code involved here could have written that patch in an hour or two. That&amp;#8217;s when I found out that I had essentially reimplemented the code that had been taken out and added the front-end to it.&lt;/p&gt;


	&lt;p&gt;I worked on it a bit more before I was done interning, then went back to school and time to work on this became increasingly rare. I dropped the ball a bit, and then suddenly we were at string freeze, and this wasn&amp;#8217;t done. Fast forward a few months; I graduated &amp;#38; started working for Mozilla full time. I found out we were still going to have another string freeze for beta 4, so I got my patch out of bitrot and continued working on it. It needed more work and testing by then due to Private Browsing and a few other changes that were made. Strings went in right before we froze them &amp;#38; the actual patch went in very last minute, and only because code freeze had slipped for other reasons.&lt;/p&gt;


	&lt;p&gt;A huge thanks to Simon for all the reviewing he did and help he gave me, &lt;a href="http://autonome.wordpress.com/"&gt;Dietrich&lt;/a&gt; for the heroic &amp;#8220;today is code freeze&amp;#8221; review and help, &lt;a href="http://en.design-noir.de/"&gt;Dão&lt;/a&gt; for fixing the problems that popped up as this had a rocky landing (there was no time to bake on trunk), and &lt;a href="http://beltzner.ca/mike/"&gt;Beltzner&lt;/a&gt; for approving this without the normal bake time.&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/zpao?a=FZrxU2C7g78:TOdQBzmpUsQ:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/zpao?i=FZrxU2C7g78:TOdQBzmpUsQ:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/zpao?a=FZrxU2C7g78:TOdQBzmpUsQ:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/zpao?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/zpao/~4/FZrxU2C7g78" height="1" width="1"/&gt;</description>
      <pubDate>Fri, 24 Apr 2009 21:32:21 GMT</pubDate>
      <guid>http://zpao.com/articles/19-undo_close_window_has_landed</guid>
      <author>paul@zpao.com (Paul O’Shannessy)</author>
      <category>mozilla</category>
      <category>sessionstore</category>
      <category>firefox</category>
    </item>
    <item>
      <title>Changing Tab Load Order</title>
      <link>http://zpao.com/articles/18-changing_tab_load_order</link>
      <description>&lt;p&gt;During the Firefox work week last month, somebody had the idea of loading visible tabs first. It&amp;#8217;s one of those things that just make sense. Since I had done some work in the SessionStore component before, I volunteered to head up this task.&lt;/p&gt;


	&lt;h2&gt;What does it do exactly?&lt;/h2&gt;


	&lt;p&gt;When you open Firefox using session restore (and through some other paths), you often load several tabs. I know I&amp;#8217;ve personally restored windows with 50+ open tabs. It takes a lot of time to load 50 tabs. One optimization that was done previously was to (roughly speaking) prioritize the selected tab, so that it would in theory load first. This change make it so that the tabs visible in your tab strip are also prioritized.&lt;/p&gt;


	&lt;h2&gt;How does it work?&lt;/h2&gt;


	&lt;p&gt;When we were doing this for just the selected tab, it was extremely simple &amp;#8211; we just reordered the array of tab data so that the selected one was first. Now we prioritize a set of tabs (keeping the selected tab first). &lt;em&gt;That&amp;#8217;s it.&lt;/em&gt;&lt;/p&gt;


	&lt;p&gt;&lt;strong&gt;To be clear&lt;/strong&gt;, this does not &lt;em&gt;actually&lt;/em&gt; improve performance. All it does is make the browser feel faster. But hey, isn&amp;#8217;t that just as almost as important.&lt;/p&gt;


	&lt;p&gt;Go ahead and try it out. It&amp;#8217;s been in Minefield (mozilla-central) for over a week and landed in Shiretoko (mozilla-1.9.1) yesterday.&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/zpao?a=JISZFRL8Jmo:5cQ76FpAHc0:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/zpao?i=JISZFRL8Jmo:5cQ76FpAHc0:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/zpao?a=JISZFRL8Jmo:5cQ76FpAHc0:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/zpao?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/zpao/~4/JISZFRL8Jmo" height="1" width="1"/&gt;</description>
      <pubDate>Wed, 01 Apr 2009 17:38:48 GMT</pubDate>
      <guid>http://zpao.com/articles/18-changing_tab_load_order</guid>
      <author>paul@zpao.com (Paul O’Shannessy)</author>
      <category>mozilla</category>
      <category>firefox</category>
    </item>
    <item>
      <title>Is The Tree Green? For Your Desktop</title>
      <link>http://zpao.com/articles/17-is_the_tree_green_for_your_desktop</link>
      <description>&lt;p&gt;&lt;a href="http://projects.tynsoe.org/geektool/"&gt;GeekTool&lt;/a&gt; is awesome. &lt;a href="http://isthetreegreen.com"&gt;Is the Tree Green?&lt;/a&gt; is awesome. So together they are &lt;span class="caps"&gt;SUPER AWESOME&lt;/span&gt;!&lt;/p&gt;


	&lt;p&gt;&lt;a href="http://www.flickr.com/photos/zpao/3382045487/"&gt;&lt;img src="http://farm4.static.flickr.com/3588/3382045487_01114ff567.jpg" title="isthetreegreen.py + GeekTool by zpao, on Flickr" alt="isthetreegreen.py + GeekTool by zpao, on Flickr" /&gt;&lt;/a&gt;&lt;/p&gt;


	&lt;h2&gt;Python?&lt;/h2&gt;


	&lt;p&gt;Historically, I&amp;#8217;m a Ruby guy, but I started learning Python for a Django project I&amp;#8217;m (barely) working on. So I picked up a book here at work &amp;#38; decided to flex my pythons a little bit. You can laugh, it&amp;#8217;s punny.&lt;/p&gt;


	&lt;p&gt;The first pass of this took me ~20 minutes, and I just tidied it up this morning so it would take command line options.&lt;/p&gt;


	&lt;h2&gt;How?&lt;/h2&gt;


	&lt;p&gt;If you&amp;#8217;re reading this and actually need to know whether or not the tree is green, then you should be able to figure it out. GeekTool is &lt;span class="caps"&gt;OS X&lt;/span&gt; only, but there are similar programs for Windows and Linux.&lt;/p&gt;


	&lt;p&gt;It&amp;#8217;s easy enough to do what I did in the image above. The program can take 2 arguments &lt;code&gt;treename&lt;/code&gt; and &lt;code&gt;output&lt;/code&gt;. Run it with &lt;code&gt;-h&lt;/code&gt; for usage.&lt;/p&gt;


	&lt;h2&gt;Code?&lt;/h2&gt;


&lt;script src="http://gist.github.com/84210.js"&gt;&lt;/script&gt;

	&lt;p&gt;A big thanks to Justin Dolske for &lt;a href="http://isthetreegreen.com"&gt;Is the Tree Green?&lt;/a&gt;. He deserves more credit for this than I.&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/zpao?a=xjEJOdPIdjs:L-HRrBxGZ9E:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/zpao?i=xjEJOdPIdjs:L-HRrBxGZ9E:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/zpao?a=xjEJOdPIdjs:L-HRrBxGZ9E:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/zpao?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/zpao/~4/xjEJOdPIdjs" height="1" width="1"/&gt;</description>
      <pubDate>Tue, 24 Mar 2009 23:08:39 GMT</pubDate>
      <guid>http://zpao.com/articles/17-is_the_tree_green_for_your_desktop</guid>
      <author>paul@zpao.com (Paul O’Shannessy)</author>
      <category>python</category>
      <category>mozilla</category>
      <category>geektool</category>
    </item>
    <item>
      <title>Your Browser is Special</title>
      <link>http://zpao.com/articles/16-your_browser_is_special</link>
      <description>&lt;p&gt;Roughly 6% of the people visiting this site in the past month were using &lt;span class="caps"&gt;IE6&lt;/span&gt;. That&amp;#8217;s mostly insignificant, but I despise &lt;span class="caps"&gt;IE6&lt;/span&gt; and had to do my part to put an end to it. So, following in the footsteps of &lt;a href="http://therissingtonpodcast.co.uk/"&gt;The Rissington Podcast&lt;/a&gt; (and surely others), I&amp;#8217;m serving up an &lt;span class="caps"&gt;IE6&lt;/span&gt; stylesheet complete with Comic Sans. I also put together a super tiny script that puts a special message up top.&lt;/p&gt;


	&lt;p&gt;&lt;a href="http://www.flickr.com/photos/zpao/3376947996/"&gt;&lt;img src="http://farm4.static.flickr.com/3559/3376947996_7b3fa08bc4.jpg" title="Your Browser is Special by zpao, on Flickr" alt="Your Browser is Special by zpao, on Flickr" /&gt;&lt;/a&gt;&lt;/p&gt;


	&lt;p&gt;I&amp;#8217;d been wanting to do this for a while, but it&amp;#8217;s finally done. I&amp;#8217;m using conditional comments to differentiate browsers. I used JavaScript to display the message so I wouldn&amp;#8217;t be adding clutter to my source, even if nobody else would see it. View the source if you&amp;#8217;re interested.&lt;/p&gt;


	&lt;p&gt;And yes, I&amp;#8217;m biased about the browser I&amp;#8217;m suggesting, but I&amp;#8217;m allowed to be.&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/zpao?a=IiH5Ayzohi0:1aLNw1dzyjE:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/zpao?i=IiH5Ayzohi0:1aLNw1dzyjE:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/zpao?a=IiH5Ayzohi0:1aLNw1dzyjE:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/zpao?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/zpao/~4/IiH5Ayzohi0" height="1" width="1"/&gt;</description>
      <pubDate>Mon, 23 Mar 2009 00:03:52 GMT</pubDate>
      <guid>http://zpao.com/articles/16-your_browser_is_special</guid>
      <author>paul@zpao.com (Paul O’Shannessy)</author>
      <category>ie6</category>
      <category>browsers</category>
      <category>blarg</category>
    </item>
  </channel>
</rss>
