Blake (old posts, page 16)

New GetAnAccount UI.

Since we released the GetAnAccount addon, we’ve had a lot of feedback. Many of the people who commented were looking for the option of getting an ad-supported account instead of paying for email access. We were always planning on integrating ad-supported services, as soon as we could, but of course, doing this required a redesign.

One important note before we get to the good stuff: I’ve used GMail soley as an example of a well-known ad-supported email provider here. We may or may not be partnering with them, and you should not take these screenshots as proof of our intentions one way or another.

As you can see from this first mockup, the initial view makes it much more obvious that you don’t need to create a new account just to use Thunderbird.

Initial View

If you click in the bottom half, it expands up to make it more obvious that that’s what you want to do, and to allow us to display more information (although we don’t have any extra information to display there yet.

Existing Address

On the other hand, if you click on the top, we do have more information that you probably want to see before continuing on.

New Address

And this is something like what we hope to show you when the results have been returned. (Note: the Terms of Service, Existing Account, and Do It Later buttons are still there, but have been scrolled off the bottom of the dialog in this mockup.)

Search Results

And finally, once you pick one of the providers, we expand that list to show you all of the results for that provider.

Provider Chosen

Feedback, as always, is welcome, either here or in the forum.

Brokeback Mountain functionality on OS X.

A co-worker of mine recently mentioned that he had a problem where he all-too-often accidentally quit his applications by hitting ⌘-q (command-q). Since he has been having problems with Thunderbird that I can’t fix, I thought I might do a little digging and see if I could come up with some way of helping him. And so here’s what I found:

In the System Preferences application, there’s a “Keyboard” section.

The Keyboard Preference Pane

One of the things you can choose in that section is “Keyboard Shortcuts”.

The Keyboard Shortcuts

Pick a relatively innocuous function, like turning Zoom on and off.

(Note: DO NOT choose Front Row for this!)

The Access Shortcuts

And assign that function to ⌘-q.

The New Shortcut

Now, whenever you hit ⌘-q, it will do whatever you selected, instead of quitting the application. Ta-da!

What files have the most bugs?

I was reading Making Software by Andy Oram and Greg Wilson, and got to the chapter about An Automated Fault Prediction System. It’s a pretty neat chapter, and it got me wondering which files in the Thunderbird code base had the most bugs. Now, I don’t have all the info I need, but I figured an easy first pass would be to go through the commit logs, and for each commit that started with “bug ”, add one to the files changed in that commit. Hmm, that sounded unintuitive. Let me just paste (and link) the code:

from mercurial import ui, hg
import operator
import re

ext = re.compile("(\.c(pp)?|\.js|\.xml)$")

repo = hg.repository(ui.ui(), ".")
changes = [repo[i] for i in repo
                   if repo[i].description().lower().startswith("bug ")]

master = {}

for change in changes:
  files = [f for f in change.files() if]
  for f in files:
    master[f] = master.get(f, 0) + 1

files = master.items()
counts = master.items()
print "\n".join([c[0] + ":" + str(c[1]) for c in counts[:10]])

And so, without further ado, here are the files that have been changed the most in bug fixes, and the number of times they've been changed:

  • mail/base/content/mailWindowOverlay.js:109
  • suite/browser/browser-prefs.js:73
  • suite/browser/navigator.js:70
  • mail/base/content/msgMail3PaneWindow.js:69
  • mail/app/profile/all-thunderbird.js:67
  • suite/common/src/nsSessionStore.js:66
  • mail/components/compose/content/MsgComposeCommands.js:60
  • mailnews/imap/src/nsImapMailFolder.cpp:56
  • suite/browser/tabbrowser.xml:53
  • mail/base/content/msgHdrViewOverlay.js:52

As a side note, for the mozilla repo it looks like this:

  • js/src/jstracer.cpp:780
  • browser/base/content/browser.js:654
  • layout/base/nsCSSFrameConstructor.cpp:410
  • layout/base/nsPresShell.cpp:400
  • js/src/jsobj.cpp:399
  • browser/base/content/tabbrowser.xml:397
  • widget/src/windows/nsWindow.cpp:390
  • toolkit/components/places/src/nsNavHistory.cpp:374
  • js/src/jsinterp.cpp:345
  • js/src/jsapi.cpp:343

Dear Santa

Dear Santa,

Everyone else is doing it, so here’s my list, too.

  • A Blu-Ray of a fireplace, perhaps with a secondary audio track of christmas music.
  • Dollhouse Season 2 on Blu-Ray.
  • Books are always nice. I’m in the mood for one of Ian Banks' Culture series, but I’m not sure which ones I haven’t read.
  • Whichever Usagi Yojimbo collections I’m missing.
  • Another two (or three!) sets of BuckyBalls. (I would get Zen Magnets, but I’ve already got BuckyBalls, and I don’t think I want to mix them.
  • a digital photo frame, for the office.
  • A tiny usb monitor. (There are also touch-screen versions for more money, but I’m a little leery about them.)
  • Perhaps an Arduino to play around with.

Well, that’s all I can think of off the top of my head.

Thanks, Blake.

Making sure I don’t forget things.

I’ve created a couple of checklists, and would like to hear any feedback on them. They are a Review Checklist, and a Commit Checklist.

They came about after I had been working mostly on experimental add-ons for a while, and then attempted to push a couple of reviewed fixes. Since I was out of practice, I managed to get something minor wrong on both of the pushes. (The first one failed to attribute the patch to the proper author; The second one failed to mention the bug number in the commit message.) Since I’m a bit of a perfectionist, this really annoyed me, and so I vowed to write up the steps that I go through when I need to commit and push a patch, so that I could refer to them later, since if checklists can save lives, then I figure they can probably also help me do my job better. But before I go to that, I needed to review a patch, so I wrote up some of the things I look for when I review a patch too.

DOM appendChild error in Gecko 2.0

I was recently modifying an add-on for the upcoming Thunderbird 3.3, and part of what I wanted to do was to run some javascript in a chrome context that added some DOM nodes to a document in a content context. But when I ran the following code:

let browser = document.getElementById('tabmail').getBrowserForSelectedTab();
let doc = browser.contentDocument;
dump("DOM Content loaded for " + doc.location + "\n");
var topBar = document.createElement("div");
topBar.innerHTML = "We got it!!!!!";
dump("iB = "+doc.body.insertBefore+"\n");
dump("fC = "+doc.body.firstChild+"\n");
doc.body.insertBefore(topBar, doc.body.firstChild);

I got the following error:

WARNING: NS_ENSURE_SUCCESS(rv, rv) failed with result 0x80530009: file /Volumes/Devel/thunderbird/src-central/mozilla/content/base/src/nsNodeUtils.h, line 304
WARNING: NS_ENSURE_SUCCESS(rv, rv) failed with result 0x80530009: file /Volumes/Devel/thunderbird/src-central/mozilla/content/base/src/nsGenericElement.cpp, line 4077
-- Exception object --
+ message (string) 'Operation is not supported'
+ result (number) 2152923145

Poking around a little, it seemed like I had reasonable things for the insertBefore method, the firstChild attribute, and the topBar variable, and so since it was late, and I couldn't see what I had done wrong, I went to bed.

That turned out to be a the best thing for me to do, because this morning Jonathan Protzenko came to the rescue, saying (in response to a similar problem with a Firefox 4.0 beta 7 extension):

If you're modifying some content DOM from chrome code, you need to make sure the child you're appending was created using the unprivileged document, not the global document.

// This is chrome code, this is wrong because the span is now chrome
// and you're trying to insert it into content

// This is right, appending a content node to another content node

I've hit this issue at least three times when upgrading stuff for Gecko 2.0. Might be what you're looking for .

And sure enough, when I changed var topBar = document.createElement("div"); to var topBar = doc.createElement("div"); , it all started working beautifully.

Thank you, Jonathan!

Some thoughts on Messaging.

This morning a friend mine tweeted that even with a bunch of high-quality newspapers around him, he was ignoring them in favour of reading twitter.

Earlier this month, I was reading Clay Shirky’s “Cognitive Surplus”. One his assertions is that it was largely a historical accident that people used to passively consume media, and now that people can produce things just as easily, we’re going to see an explosion of “participatory culture”, as they use those products to socialize with each other.

For some reason, this morning those two ideas really came together in my mind, and it hit me that messaging on the internet is going to be huge. Like, really, really huge. Even bigger than you think. And I believe that it will end up going one of two ways.1

One of the two futures I can imagine is full of places like Facebook, where you can only communicate with people who are on the same service as you, and every service is trying to own your online identity. I’ve lived in that environment with instant messaging clients, and I’m not a huge fan. Having to check five or ten different websites is almost as much of a pain as having to run five or ten different instant messenger programs. (Or having the one multi-protocol client frequently lose service on one or more of the networks when the provider decides to cut them off.)

The other is one where all the services can interoperate, and you can communicate with all your friends, relatives, and co-workers from a single program which will go out and get the messgages, sort them, collate them, maybe even rank them in terms of importance, or do a million other things that I can’t even think of. A world where if one messaging service provider decides to cancel your account for some reason, you’re not cut off from the people you knew there, and you still have all the images you uploaded, and messages you posted, and can send them all to a new provider, without losing anything.

That second world is the one I want to help make happen, and I’m very fortunate that people are paying me to do just that. I’ll stop talking now, but only after saying that you can help, too.

  1. Well, to be honest I think it’s far more likely to be some combination of those two futures, and perhaps some other things that I can’t predict. Stuff rarely ends up as just one thing or another. 

A quick roundup of the GSoC projects I was involved in.

Daniel’s QuickLook Support

There’s an extension which adds QuickLook support to Thunderbird. To run correctly, it needs a patch to msgHdrOverlay (included in the repo).

The extension is also packaged as a set of changes to Thunderbird, which you can find over here. Daniel is working on testing those changes and then turning them into a patch which we can review, and eventually add to Thunderbird. For now, the changes to Thunderbird need to go in a qlxpcom subdirectory under mailnews/extensions, and there are two diffs which need to be applied. See bug 457546 for updates.

Ian’s Improved Attachment Handling

Ian decided that the easiest way forward on this would be to concentrate on the DataMiners extension. He did all of his work in a fork on BitBucket, but it has since been pulled into the official repository.

I’m quite happy with the amount of work they both put in, and am looking forward to seeing them continue to develop their projects in the future.