I am having trouble following the explanation here about receiving startup notifications in a Firefox extension. It says there to add
category profile-after-change MyComponent @foobar/mycomponent;1
to chrome.manifest. What do I put for MyComponent and foobar/mycomponent;1?
My extension is actually a plugin for another extension. In its main .js file, I have
MainExtension.MyPlugin = {...
and then define all of my functions inside of my MyPlugin object property of the MainExtension’s object.
I believe that I should set MyComponent to MainExtension.MyPlugin. I am not sure about the second part. I am also not sure what I need to do to call the function that I want called on start up. Looking at some other extensions, I think I might need to add an observe() method to MainExtension.MyPlugin that calls another function when it receives a profile-after-change notification, but I am not sure.
As Wladimir Palant noted in a comment to the question, to use the profile-after-change notification you have to have an XPCOM component. Then
MyComponentis the class that component creates and@foobar/mycomponent;1is the component’s contract id. I didn’t know what these were because my extension simply overlays another extension that defines an XPCOM component. My extension doesn’t have its own XPCOM component.