Offline Zimbra with Firefox
In my new job at Mozilla I've been working on adding offline support to Zimbra as a proof of concept of the new Firefox offline capabilities.
Zimbra is heavily ajax based and gives a good idea of how difficult or easy it is to convert an existing application to use the offline support. For this first cut I made Zimbra work when the browser is in offline mode and provide the ability to browse the email folders, and view messages while offline that are held in the Inbox and Drafts folders.
The Firefox features used to enable offline operation were:
It's the first screencast I've out together so hopefully it comes out ok. I used the excellent 'wink' tool.

Categories: firefox, zimbra
Zimbra is heavily ajax based and gives a good idea of how difficult or easy it is to convert an existing application to use the offline support. For this first cut I made Zimbra work when the browser is in offline mode and provide the ability to browse the email folders, and view messages while offline that are held in the Inbox and Drafts folders.
The Firefox features used to enable offline operation were:
- DOM Storage for storing emails and folder information. DOM Storage is an implementation of a WHATWG specification.
- Offline Cache. A patch is available for Firefox that adds an offline cache specifically for web applications to store data (like images, pages, etc) that must be available while offline. Items are loaded in the cache using a rel="offline-resource" element on a <link> element.
- JAR file Protocol. Firefox accepts JAR protocol URLs. These reference individual items in a JAR file and allow convenient bundling and caching of resources. For example, to reference the file /core/AjxCore.js in the ajax.jar file, the URL would be: jar:/zimbra/js/ajax.jar!/core/AjxCore.js
- Offline Events. The browser has "offline" and "online" events that are triggered when the user chooses to go offline via the menu, or when network connectivity is lost. I modified Zimbra to listen for these events and display a status indicator showing whether it is in offline or online mode.
It's the first screencast I've out together so hopefully it comes out ok. I used the excellent 'wink' tool.

Categories: firefox, zimbra
Labels: mozilla

11 Comments:
So cool. Pity I never unplug my laptop. I swear, if it doesn't have 'net access I just stare at it, I'm never sure what to do with a non-connected PC. Even my games require 'net :/
Heh, I felt the same way when I first got to Auckland and had no internet access. I'd turn the laptop on, stare at the screen, and think 'now what'. Then turn it off :)
This is hot like a fire. Count me amongst the incredibly eager to see this work progress. Way to go.
Very, very cool!
Looking forward to more news on this front.
How is this different from what Zimbra states in their blog post of taking Zimbra offline
http://www.zimbra.com/blog/archives/2006/11/taking_zimbra_offline.html
This is great but as I understand it, this is a Firefox only solution at the moment - Zimbra themselves implemented offline capability some time ago and this is not just for Firefox.
http://www.zimbra.com/blog/archives/2006/11/taking_zimbra_offline.html
This is pretty cool, I wonder if I can download it somewhere to play with it.
Very exciting, but I wish that Wink show went slower. I noticed that you used Minefield, but you didn't show us Help>About so we could know which one, or which OS, and whether it was specially compiled using that patch.
I immediately think of the potential on my Nokia N800. This presents an opportunity to work evangelism on Ari Jaaksi, Nokia's Open Source head.
Robert, yes I've seen the Zimbra offline articles and it looks like it will be excellent. The point of what I've done is not to provide an alternative but to do a test to see if the APIs in Firefox enable offline functionality in complex Ajax applications.
Francois, it's Firefox only in that I'm testing the Firefox APIs. Some of these APIs are WHATWG standards so it's likely that other browsers will implement the as well. If that happens then it won't be Firefox only. The same code will run on other browsers.
It's certainly possible to write cross browser offline applications by abstracting out a common interface. This is what the Dojo Offline Toolkit and similar efforts are doing.
Greg@Zimbra, I'm adding the ability to edit drafts offline then something will be made available.
Flux, the speed of the screencast is my fault, sorry. The minefield version is a CVS build from the trunk with the offline cache patch applied. Hopefully the patch will be in the trunk soon so it becomes easier to build. I agree that devices like the N800 will probably have good use for offline web applications. I ran the demo on a Windows XP machine.
Just to mention, since I found this blog searching for zimbra offline, that it's now available from http://www.zimbra.com/products/desktop.html I actually use a hosted provider www.simplymailsolutions.com and the desktop is working very nicely and proving that ajax is a technology which can work just as well offline as online (which I think was the point of this article rather than anything zimbra specific)
Interesting times ahead!
Offline client should be available with Zimbra 5, in November. The Zimbra Desktop ap for Mac/Win is currently still in alpha, is expected to be in beta at the same time as the general release of Zimbra 5, according to chatting with one of the help desk team members at my Zimbra hosting provider 01.com.
Post a Comment
<< Home