Web Progress Notifications in Fennec

Working on OpenAttribute for Firefox Mobile (Fennec) yesterday, one of the first challenges I faced was how to get notification that a page had finished loading. In the desktop version, I attach a listener for all tabs using gBrowser.addTabsProgressListener. Unfortunately with browsers running in their own processes, this approach doesn’t work on Fennec. I spent quite a bit of time trying different approaches, all with the intent of creating a progress listener and attaching it myself. The Electrolysis wiki page says that one of the nice side effects of the message passing model is that this problem is easy to solve, but it sure didn’t feel easy.

I don’t remember why I eventually started looking at the mobile-browser source tree, but as I looked through browser.js, there it was:

messageManager.addMessageListener("Content:StateChange", this);

It turns out it is really easy: you can listen for Content:StateChange or Content:LocationChange, and get access to the same details you’d normally have in the WebProgressListener implementation.

date:2011-04-04 20:41:18
wordpress_id:1889
layout:post
slug:web-progress-notifications-in-fennec
comments:
category:mozCC
tags:fennec, firefox, mobile, mozcc, OpenAttribute

Unexpected Attribution

I’m working on adding support for Firefox Mobile to OpenAttribute this weekend. I’d hoped to get that done in time for the official launch, but, well, things have been a little busy. Firefox Mobile (Fennec) uses Electrolysis, a multi-process architecture that’s a little different from what I’m used to. Looking at the documentation and APIs, it actually looks a little closer to Chrome’s extension architecture. I was looking at tutorial videos yesterday, and downloaded Mark Finkle’s boilerplate addon to get a better look at the overlays.

As I explored the boilerplate, I opened the build script. Imagine my surprise when I read this comment at the top of the script:

#!/bin/bash
# build.sh -- builds JAR and XPI files for mozilla extensions
#   by Nickolay Ponomarev <asqueella@gmail.com>
#   (original version based on Nathan Yergler's build script)
# Most recent version is at &lt;http://kb.mozillazine.org/Bash_build_script&gt;``

I have to assume this is based on the build script I developed for MozCC in 2004. I doubt anything from the original still survives (or at least I hope not), but appreciate the credit.

date:2011-04-03 10:53:00
wordpress_id:1881
layout:post
slug:unexpected-attribution
comments:
category:mozCC
tags:fennec, firefox, mozcc, OpenAttribute