Closed Bug 632637 Opened 13 years ago Closed 13 years ago

Extension onInstall, onUpgrade event

Categories

(Toolkit :: Add-ons Manager, enhancement)

x86
macOS
enhancement
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 416246

People

(Reporter: thegooddale, Unassigned)

Details

User-Agent:       Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:2.0b12pre) Gecko/20110208 Firefox/4.0b12pre
Build Identifier: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:2.0b12pre) Gecko/20110208 Firefox/4.0b12pre

I've been using this method in my extension to run some code on installation/upgrade: https://developer.mozilla.org/en/Code_snippets/On_page_load#Running_code_on_an_extension.27s_first_run_or_after_an_extension.27s_update

But I've never really been happy with that method. It feels a bit hackish. 

What I would really like is to have an event that I could hook into.

e.g.

Application.addEventListener('extensionInstall',function(e,ID){
  if(ID==myExtensionID){
    //run some code on first install of extension
  }
},false);

Application.addEventListener('extensionUpgrade',function(e,ID){
  if(ID==myExtensionID){
    //run some code on upgrade of extension
  }
},false);


Reproducible: Always
Component: General → Add-ons Manager
Product: Firefox → Toolkit
QA Contact: general → add-ons.manager
Basically bug 416246 although that may end up not getting implemented now bootstrap scripts already have this. Also the new AddonManager sends out very good event notifications for this sort of thing.
Status: UNCONFIRMED → RESOLVED
Closed: 13 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.