iosart.com | projects | articles | photos | about

Install Google Gears in a XULRunner app in 3 quick steps

BoltzAs I mentioned in my previous post, I’m now using Google Reader in WebRunner as my main RSS aggregator.

A few days ago, Google released Google Gears – it’s a browser add-on that allows various Web apps to work offline by providing them with ways to store and retrieve information locally. As one of its first implementations, Google Gears allows Google Reader to work offline.

While Google Gears installs and works seamlessly with Google Reader in Firefox, there are a few things that need to be tweaked in order to make it work in WebRunner or any other XulRunner application. The actions below are somewhat Windows specific, but something very similar can be done on any platform.

  1. Register as a global extension – by default, Google Gears installs itself as a Firefox global extension in Windows registry:

    [HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\Firefox\Extensions]
    {000a9d1c-beef-4f90-9363-039d445309b8}=C:\\Program Files\\Google\\Google Gears\\Firefox\\

    In order to add it to WebRunner we need to add the following key to the registry:

    [HKEY_LOCAL_MACHINE\SOFTWARE\WebRunner\Extensions]
    {000a9d1c-beef-4f90-9363-039d445309b8}=C:\\Program Files\\Google\\Google Gears\\Firefox\\

    The exact registry path is different for every XulRunner application, but the basic structure is “HKLM\Software\VENDOR\APP_NAME\Extensions”. In WebRunner case there is no “Vendor”, so it’s just “HKLM\Software\APP_NAME\Extensions”.

  2. Add WebRunner compatibility to Gears manifest. Locate the Gears extension manifest install.rdf file (typically in C:\Program Files\Google\Google Gears\Firefox), and add the following lines:

    <em:targetApplication>
    <Description>
    <em:id>webrunner@webapps.org</em:id>
    <em:minVersion>0.1</em:minVersion>
    <em:maxVersion>10.0</em:maxVersion>
    </Description>
    </em:targetApplication>

    “webrunner@webapps.org” is the ID of your WebRunner XulRunner application. For other XulRunner apps, you can find out the correct ID in their application.ini file.

  3. Add Extension Manager support to WebRunner. Locate the main WebRunner application manifest file – application.ini (typically found in C:\Program Files\WebRunner) and add the following lines:

    [XRE]
    EnableExtensionManager=1

Basically, the first step makes sure that WebRunner detects the extension, the second one makes Gears compatible with WebRunner and the third makes WebRunner load the Google Gears extension. Once you complete these three steps, Google Reader and any other supported Web app will detect and use Google Gears for offline functionality.

20 Responses to “Install Google Gears in a XULRunner app in 3 quick steps”

  1. Alex Says:

    I tried to modify your suggestions so that this would work on OS X. Where exactly do you enter

    webrunner@webapps.org
    0.1
    10.0

    Into the install.rdf file?

  2. Alex Says:

    I mean, where do you add the WebRunner compatibility text into the install.rdf file? At the end? The middle?

  3. Iosart Says:

    @Alex – the new ‘targetApplication’ xml tag should be added as a sibling to the existing ‘targetApplication’ tags in the file

  4. Greg Says:

    This is really great stuff. I think google reader w/ gears in webrunner with a normal icon that shows up in the taskbar, no chrome nubbins, no statusbar, no browser menus etc is the best rss reader by far. Using webrunner also allows the original page links to open in your default browser, so your webrunner instance is not opening new windows/tabs.

  5. Rafael Madeira Says:

    Can’t a similar procedure be used to enable extension support on WebRunner once and for all? Or just for the Google Reader Notifier extension, so as to provide alerts when there are new feed items available?

  6. links for 2007-09-27 « AB’s reflections Says:

    [...] Install Google Gears in a XULRunner app in 3 quick steps Installing Google Gears in WebRunner (XULRunner) so that Google Reader (& others) can be used in offline mode (tags: google-reader google-gears webrunner browser configuration) [...]

  7. robert Says:

    unfortunately, the webrunner keeps crashing after i do this. :(

  8. Pascal Van Hecke - Daily Links » 2007 » October » 04 Says:

    [...] Install Google Gears in a XULRunner app in 3 quick steps things that need to be tweaked in order to make it work in WebRunner or any other XulRunner application: Register as a global extension Add WebRunner compatibility to Gears manifest Add Extension Manager support to WebRunner (tags: googlereader webrunner xulrunner googlegears firefox extension howto) [...]

  9. Eric Says:

    I posted an updated version of this hack for WebRunner 0.7 :

    http://www.neyric.com/blog/webrunnerxulrunner-and-google-gears

    However, I wasn’t able to make it work. Same problem as robert.

  10. Mark Finkle’s Weblog » WebRunner Followup Says:

    [...] listed above. Its not visual, so there shouldn’t be an overlay problem. It is possible to hack support for Gears into WebRunner. The best plan for Gears might be to suggest a patch to the Gears [...]

  11. eugene Says:

    WebRunner 0.7 is using Mozilla 1.9 codebase. As you know Mozilla 1.8.1 and 1.9 are using different dll architecture (for instance mozilla 1.9 don’t use xpcom_core.dll). But google gear is still making based on 1.8 codebase for performance issues. by that reason webrunner 0.7 can not use google gears now. when firefox 3(1.9 codebase) open, maybe google gears can support webrunner 0.7. BUT I’m not sure when firefox 3 will be opened.

  12. desimo Says:

    No luck getting fireftp to work in webrunner either. Anyone know if that’s a possibility?

  13. Lucky Disasters » Blog Archive » WebRunner now Prism, Whatever - Here’s How To Make An Extension Compatible With At Least One… Says:

    [...] found this parts of this bit of magic on Alex Sirota’s website along with the tip to check in the applicaiton.ini file for any [...]

  14. Pranav-Sundar Says:

    What is the least XULRunner framework version that supports Google Gears ?.

  15. Pranav-Sundar Says:

    On Windows, i tried to integrate Google Gears Firefox extension
    with
    XULRunner 1.8.0.9, its not working. but it works fine with XULRunner
    1.8.1.3. Is there any patches available to make it work with 1.8.0.9.

    Please, could any one shed some light on this.

  16. neyric’s JS » Blog Archive » WebRunner/XulRunner and Google Gears Says:

    [...] I get even more excited when I found out that Alex Sirota added Google Gears support on WebRunner. [...]

  17. Bhasi Bahuleyan Says:

    It is installed. But what next?

  18.   Linkdump perdido - Fudeblog by Cesar Cardoso Says:

    [...] é o primeiro passo para aplicativos web off-line, o segundo passo foi narrado pelo Mark Finkle; o resultado é bem interessante (via Planet Mozilla) EDIT 200706051718: Um uso mais ‘concreto’ é o do Remember the [...]

  19. bmk789 Says:

    how can i do this on linux?

  20. Manolo Says:

    i tried to do this today on Prism 0.9 without success, i dont found the registry key::

    [HKEY_LOCAL_MACHINE\SOFTWARE\WebRunner\Extensions]

    so i create this:

    [HKEY_LOCAL_MACHINE\SOFTWARE\Prism\Extensions]

    in the 2 step i put this:


    prism@developer.mozilla.org
    0.4
    1.0.0.*

    the 3 step is not necesary,

    But i have not success… any ideas?