Add-ons and Restarts – Yuck!

There has been a lot of discussion about the future of the Mozilla add-on infrastructure. I think it’s clear now that Mozilla is not removing the classic add-on mechanism. In fact, Fabrice Desré found a nice bit of news on an upcoming feature (via comments on Atul’s post):

Fabrice: Does the fact that jetpacks are now XPIs mean that the “no restart after install” feature will be implemented for traditionnal add-ons ?

Atul: That’s correct! We don’t have a bug filed for it yet, still need to do that, but the idea is that if an extension includes certain metadata in its install.rdf that essentially tells Firefox “look, I know how to unload all my resources reliably”, then Firefox will trust it and call a certain function whenever the extension needs to unload itself.

Mossop: I’ll just elaborate a little. Plans are naturally in flux right now but the idea is to allow XPI packages to install without restarts if they wish, however there will be constraints. They will be responsible for doing everything themselves, which means (at least in my head right now) we won’t automatically load chrome or components from these extensions. Instead we will just do startup and shutdown calls into the extension and allow it to register/unregister what it needs by itself. This means that just marking an existing extension to work without restarts wouldn’t get you anywhere, you still need to do the extra work to handle the startup/shutdown parts.

This is great news for add-on developers! I’m sure MDC will have some code snippets for dynamically loading chrome overlays and components to make it easy to support no-restart add-ons.

3 Comments

  1. Wladimir Palant said,

    January 13, 2010 @ 9:50 am

    Yes, if that’s finally being worked on then this is great news. However, I wonder whether there will be “document.unloadOverlay()” – or is one supposed to remove all UI integration manually? If it is the latter then restartless extension updates might get pretty ugly…

  2. Peter Nemšák said,

    January 13, 2010 @ 2:09 pm

    I’d have to agree with Wladimir, “doing everything themselves” sounds a bit scary now, when we don’t know exactly what “everything” means …

  3. Adrianer said,

    January 13, 2010 @ 5:02 pm

    That’s really great news! :)
    Now I’ll have to wait until Komodo will have it to enable it for my extension ;)

RSS feed for comments on this post