RELnemtzov
RELnemtzov

Reputation: 81

What is the best way to check if an addon is a new install or has an update when using the Firefox addon SDK?

I'm developing an addon with the addon SDK (no restart).

What would be the best way to check if an addon has just been updated or installed for the first time?

I would like to open a new tab with a changelog or recent changes upon install or update (no restart).

Upvotes: 1

Views: 53

Answers (1)

Wladimir Palant
Wladimir Palant

Reputation: 57661

You should use the loadReason property:

var self = require("sdk/self");
if (self.loadReason == "install" || self.loadReason == "upgrade")
  ...

Upvotes: 2

Related Questions