[ Thanks to SilverWave for this link.
]
“Dave Townsend did some really great work on the add-on
manager recently, he managed to completely rewrite the old crappy
backend code and replace it with something far more sane. Along the
way a new feature was added: starting with Firefox 4 some add-ons
should be able to opt-in and install/uninstall without requiring a
browser restart. This feature was primarily meant for JetPack-built
extensions but is generally open to all other extensions as well. I
tried enabling this feature for Adblock Plus and found that there
is an awful number of catches attached to it. I wrote these down,
might save somebody else’s time:* Catch 1: No XPCOM components. What you get is a single
JavaScript file (bootstrap.js) that will run when your extension
needs to initialize itself or shut itself down. Solution: move all
global code you might have into JavaScript modules, load these
modules from the bootstrap script and register XPCOM components
dynamically. Do
Components.manager.QueryInterface(Ci.nsIComponentRegistrar) and
call registerFactory() the required number of times.”