Wednesday, January 3rd, 2007

Dojo Offline Toolkit Kicks Off

Category: Dojo, Offline

<p>Brad Neuberg has started work on the Dojo Offline Toolkit backed by the generosity of SitePen.

What is the Dojo Offline Toolkit?

The Dojo Offline Toolkit will be a small, cross-platform, generic download that enables web applications to work offline.

Let’s look at the Dojo Offline Toolkit from a user’s perspective. Imagine Alex is using a web-based real estate application for realtors built with the Dojo Offline Toolkit. In the upper-right corner of this web application is a button that says “Work Offline.” The first time Alex clicks on this button, a small window appears informing him that this web application can be accessed and used even if he is offline. If Dojo Offline has never been installed, Alex is prompted to optionally install a small 100K through 300K download that is automatically selected for his appropriate OS, including Windows, Linux/x86, and Mac OS X/Universal Binary.

Once Dojo Offline is installed with the included installer, the web-based real estate application prompts Alex to drag a hyperlink to his desktop and bookmark the web application’s URL. As Alex works online, anything that should be available offline is simply stored locally. If Alex is offline, he can reach his application by simply double-clicking the link on his desktop, opening its bookmark, or by simply typing in its normal web address. The application’s user-interface will magically appear in the browser, even if the user is offline, and all offline data will be retrieved from and stored into local storage. Dojo Offline detects when the network has reappeared, allowing the web application to send any data stored in local storage to the web server.

Local storage is done using Dojo Storage, which allows web applications to store hundreds of K or megabytes of information inside the browser, with the user’s permission. Dojo Storage is complete and works across 95% of the existing installed base of the web, including Firefox, Safari, and Mozilla on Windows, Linux, and Mac OS X. The Dojo Offline Toolkit will come bundled with Dojo Storage.

Once Dojo Offline has been installed, it will work for any web application that codes to it — it is completely generic and has no application specific information in its download. Applications have a consistent, simple API they can code to, the Dojo Offline and Dojo Storage APIs, to enable offline ability. Even better, since the user always interacts with the web application through its domain name, rather than through a file:// URL or http://localhost domain name, the web application runs under the same security policies as standard web sites, which means a user’s machine will not be compromised by an untrusted web application. The Dojo Offline Toolkit will work in Internet Explorer, Firefox, and Safari, and will run on Windows, Linux/x86, and Mac OS X/Universal Binary.

The Dojo Offline Toolkit will be fully open source, available under the same licenses as Dojo: the BSD and the AFL.

The work is done via the Proxy AutoConfiguration (PAC) feature in our browsers, and the final deliverable will consist of:

  • the Dojo Offline proxy
  • installers and uninstallers
  • PAC file generation and registration
  • the Dojo Offline API for easy, application-level access
  • the Dojo Offline web-based installer UI for downloading Dojo Offline documentation
  • a sample application, Moxie, modified to work with Dojo Offline
  • QA and bug fixing

Good luck to Brad. We look forward to hear about your experience, and progress!

Posted by Dion Almaer at 12:01 am
16 Comments

++++-
4.1 rating from 43 votes

16 Comments »

Comments feed TrackBack URI

This is big news!

Comment by Diego Carrion — January 3, 2007

Apollo is also coming out late January – I think this is the direction things are going….

Comment by Alex MacCaw — January 3, 2007

This is great, and shows that there is a lot of potential here, and with Adobe Apollo, for web applications that run over occasionally connected networks, or want access to local storage.

I’ve taken a similar approach of using a proxy to add offline capabilities to web applications. The approach differs to Dojo by embedding a javascript environment and sqlite database in the proxy as well, so that you can have local logic to control synchronisation when online/offline etc.
More info and some code at http://www.web2os.com.

Comment by Rhys — January 3, 2007

What are the real world use cases for this. Applications that come to my mind need the server side processing / business rules and database to do something useful. Offline data entry where the next entry does not depend on the result of the processed prior entry?

Comment by Martin — January 3, 2007

I agree with Martin. How many web applications can really maintain functionality without that live connection to the server side logic and data? This is all not to mention the incredible security concerns that arises. This is such a cool idea but it seems that Dojo is following the MS mentality of valuing function over security.

In my opinion, anything that gives a web application elevated permissions to my local system/resources is a BAD idea outside the realm of an intranet business application.

Comment by Andrew — January 3, 2007

Andrew and Martin–
Dojo Offline uses Dojo Storage for its actual storage, which can be either Flash-based or part of the new storage API proposed by WhatWG and implemented in FF2. Both storage APIs are sandboxed and limited in terms of security; as Brad talks about in his post at SitePen, the surface area for attacks are very limited. If I remember correctly, the concepts are similar to the MS.NET System.IO.IsolatedStorage concept, which is designed to be isolated from the rest of the system…the point is that security and possible hacking attacks are a huge concern for Dojo, and we wouldn’t release ANYTHING that we knew would compromise a user’s system.

Comment by Tom Trenka — January 3, 2007

Andrew, I think that web applications can maintain a fair bit of functionality without persistent connection to the server side logic. Google Maps has all the application logic client side in the browser, for example. I do agree with Martin, however, in that a local database and a subset of the business logic is needed for a lot of the existing web applications to be offline capable, but this does not need a full-blown version of the server code on the client. In web2os, for example, the proxy code to allow offline use of Google Calendar comes in at under 500 lines of javascript.

On the security side, the use of the referer field that Brad mentions is a good way to restrict access to the browser-proxy link, and the proxy allows you to have an intermediate level between your desktop and the web in which to maintain finer-grained security / access control etc.

Comment by Rhys — January 3, 2007

There are lots of real-world uses cases. Take for instance applications that are used by a sales force, when sales people go to customer sites they need to have access to data but are not usually connected to a network. The information needed would be stored local to the user’s machine allowing interaction and editing of data. Then when they get back online the information would them be synchronized with the server.

Offline access is a barrier for a certain class of applications. This is great, I can’t wait.

Comment by Robert Buffone — January 3, 2007

Finally, I can have applications without being connected to the internet. If only this could have been done 15 years ago … oh wait.

Comment by Dan — January 3, 2007

Martin: The blog post has several real-world examples of how the Dojo Offline Toolkit can be used offline.

In terms of security, Tom is right. I try to keep the area of trust to just the local proxy, which is generic and not application specific — it is simply an open source, standard web proxy, slightly modified to work better offline from it’s cache. All applications that want offline ability interact through a synthetic web address, installed by the Dojo Offline Toolkit during installation into the browser through a Proxy AutoConfiguration file, which basicly configures the browser to talk to the proxy, so everything is restricted by the browser’s normal web-based policy, even communication with the local proxy.

I agree that it would be nice to have true SQL capabilities; don’t forget that the next 3 months is just the first release of the Dojo Offline Toolkit. The maximum size of the toolkit must always be 700K or less, the size of the initial Flash plugin. Right now 100 to 300K of that will be consumed by the web-based proxy and, which leaves several hundred K for a cross-platform, small SQL or SQL-like relational database. If someone wants to do this during the next 3 months with me, that would be a great contribution. Email me at bkn3@columbia.edu if you want to take this on. I would want alot of thought about the security ramifications though.

Comment by Brad Neuberg — January 3, 2007

BTW, I don’t have plans to develop a SQL/queryable data-store component for now — what I was saying is if someone else wants to shoulder that I would be open to considering it.

Comment by Brad Neuberg — January 3, 2007

Man, Dojo looks more and more appealing every day. I may have to give it a shot.

Comment by Aaron — January 4, 2007

what happens when you want to actually use the site that you are hitting as a web site and access it from multiple points? if the world adopts dojo storage, that means i cant visit a site from different computers without losing my data that could be stored on a server. its a cool idea, but why not just use client/server apps that have a network connection?

Comment by brian — January 6, 2007

Sounds a lot like TiddlyWiki to me. Its interesting that you just drag the link onto the desktop though.

Comment by Bradley — January 8, 2007

Can Dojo be downloaded now? how can i work on the source?

Comment by chris — January 9, 2007

Brian: Dojo Offline will include synchronization, so that when you go back online your local data will be pushed back to the server; this means if you later access the web site from a different machine, the server should have the latest versions.

Bradley: This is like TiddlyWiki; three differences: this is a framework so anyone can use it in their apps, not just TiddlyWiki; it doesn’t require you to make a Single Page Application that fits in one file and is loaded from the file system, as TiddlyWiki does; and it can work with multi-user, client/server situations, which stock TiddlyWiki doesn’t (there are some plugins to push your Tiddly changes to a server, but these are third-party extensions).

Chris: Dojo lives at http://dojotoolkit.org . There is currently not source for Dojo Offline; as I code all my changes will be in a public subversion repository that you can follow and download.

Comment by Brad Neuberg — January 19, 2007

Leave a comment

You must be logged in to post a comment.