Hello,

I have a javascript component in my extension for firefox 1.5. This component implement a new stream converter (from=application/atom+xml&to=*/*).

But I would like something like, to load this component at the firefox startup only if a user boolean preference is true.

My component registering is based on the xpcom/sample/nsSample.js.
For the moment, the only solution I have found is, in the createInstance method of the factory, get the user preference, and if it's false throw a Components.results.NS_NOINTERFACE. It work, my stream converter is no more applied if the boolean is false. But I find that this is not beautiful, memory is always loaded even it's not necessary, and I have ugly exceptions in the javascript console

Is there a way to dynamically load or register a javascript component of an extension at startup? Or another manner to do ?

Thanks in advance for any responses.
_______________________________________________
dev-tech-xpcom mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-xpcom

Reply via email to