Closed Bug 997408 Opened 11 years ago Closed 11 years ago

Need an event that first after an add-ons startup scripts have run after install

Categories

(Toolkit :: Add-ons Manager, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 864650

People

(Reporter: mossop, Unassigned)

Details

All of the current install events (onInstalled, onInstallEnded) trigger before we load and run a bootstrapped add-on's scripts. This causes us to use executeSoon tricks in tests to make sure that add-ons have started and there's even a nice warning in the code about doing things in onInstallEnded when cleanup may not have happened. This will only get worse if we implement bug 771441. We should add a definitive way to know when the scripts have finished. One straightforward way would be to add a new event ("onInstallScriptsRun" or something?). Another option that I think might be better would be to keep addon.active false when firing onInstallEnded, then fire onEnabling, call the scripts and call onEnabled. That should be a supported scenario anyway as add-ons can be installed disabled (blocklisted etc.). What do you think Blair?
Flags: needinfo?(bmcbride)
Hmm, we have bug 864650 already for adding an event for when a bootstrap method has been called. But I definitely agree on your point about firing onEnabling/onEnabled - seems like something that needs fixed regardless. Perhaps these solutions are complementary? Bug 864650, at the very least, is the better and most direct approach if specifically tracking bootstrap method calls is the actual goal of the code (as opposed to overall state of the add-on).
Flags: needinfo?(bmcbride)
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.