I want to make two extensions that make use of the same component, but
I want either extension to be able to be installed independently of
the other, but not necessarily exclusive of each other. I want to
avoid making one extension dependent on the other. Is there a way for
me to make them both use the same XPCOM component (with the same CID
contractID etc.). The component is a service that does background
scanning, so I don't want to have two duplicate instances running in
case they conflict.
Is this possible?
Thanks,
James.
Hi,
There are probably two way to do this, maybe more.
1. Include the identical component in both extensions. Be sure to use the
same contract ID, GUID, etc. The first extension to be installed will
successfully register the component. Subsequent extension installations with
the same XPCOM component will fail registration of that component, but that
is not a fatal error for your extension. Life continues and the original
component is used by both extensions :) You should test this to be sure, but
I'm fairly certain that is how things will behave.
2. You can do something like what jslib does:
http://jslib.mozdev.org
http://jslib.mozdev.org/docs.html#using_in_app
package your XPCOM component in its own XPI
Also take a look em:requires in install.rdf:
https://developer.mozilla.org/en/Install_Manifests#requires
Note that <em:requires/> doesn't download and install the XPI for the user
automatically.
Eric
-James
2009/4/16 Eric Jung <eric...@yahoo.com>:
> _______________________________________________
> dev-extensions mailing list
> dev-ext...@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-extensions
>