Sunday, May 31, 2009

Installing Mozilla addons in Sugar's Browse

Lucian Branescu thinks it would be useful for his Webified project if Browse could run Google Gears.

Browse is unfortunately unable to install and directly use .xpi files, even if it's based on Mozilla. Maybe adding support for this doesn't depend on too much stuff only in Firefox and it could be quite easy. If someone would like to investigate a bit, would be very nice. But for now we can do some dirty tricks to get it up and running.

Steps:

  • expand gears-linux-opt.xpi with unzip,

  • move the files inside the components dir (bootstrap.js, gears.xpt, libgears_ff2.so and libgears.so) to $(prefix)/lib/hulahop/components,

  • move the file inside the lib dir (update.js) to $(prefix)/lib/hulahop/lib,

  • move the dirs inside the chrome/chromeFiles dir (content and locale) to a new dir called $(prefix)/share/hulahop/chrome/gears,

  • copy the file chrome.manifest to $(prefix)/share/hulahop/chrome/gears.manifest, mind the file name change. Also make this change to the file contents:


--- chrome.manifest 2009-05-19 20:34:46.000000000 +0200
+++ ../../install/share/hulahop/chrome/gears.manifest 2009-05-29 12:26:36.000000000 +0200
@@ -1,4 +1,4 @@
-content gears chrome/chromeFiles/content/
+content gears gears/content/
overlay chrome://browser/content/browser.xul chrome://gears/content/browser-overlay.xul
locale gears en-US chrome/chromeFiles/locale/en-US/
locale gears ar chrome/chromeFiles/locale/ar/


That would be enough, but unfortunately Gears will be of little use for now until this bug gets fixed in Mozilla, because the security dialog will be too small and you won't be able to authorize web sites to use Gears. Let's hope this gets fixed soon!

And now for the obligatory screenshot:

3 comments:

Craig said...

Instead of using Google Gears, why not promote HTML 5's offline storage? It is a feature of Firefox 3.5, which I assume will be on the OLPC soon. No plugin reuqired, and it's a web standard.

Tomeu Vizoso said...

> Instead of using Google Gears, why not promote HTML 5's offline storage?

Yeah, the plan is to promote the standard APIs but many apps out there are still depending on Gears.

Personally, I just did this work to make sure that we have written somewhere the steps to make an extension work in Browse.

Anonymous said...

The main reason I can imagine for using Gears over HTML5 offline is that the latter imposes a 5MB per domain storage limitation. That may be enough, but I'm not aware of any such limit in Gears.