Tuesday, October 09, 2007

My Yahoo! Hackday hack..

Had a wonderful time at the yahoo hackday this weekend. Akshay and i ended up trying to get Flickr work offline using Google gears and Greasemonkey.

Gears is an excellent extension for firefox that lets web developers provide offline capabilities to their web applications. It comes with a sqlite3 databases to retain files and data in offline mode. The latter is script accessible on a same origin policy.

Gears does not work out-of-the-box using greasemonkey. The first problem is that gears does not get initialized for lack of permissions. The gears folder inside .mozilla/firefox folders has a permissions.db file - essentially a sqlite3 database. This has a table called Access, which contains permissions for websites. We manually inserted a row for flickr.com and gears initialization problem was solved.

There were also numerous other problems, some of which i have no clue yet. Firefox kept crashing when we tried to save resources using the LocalStore. We could also not get WorkerProcess working when using greasemonkey. The flickr webpage served from multiple domains - different farms for the images, different other yahoo domains to serve css, scripts etc - did not help us either.

We did end up with getting flickr to work offline, though without a lot of non-photo images and css. I plan to continue trying out gears and greasemonkey, will post an update when i learn more.

Labels: ,