Although there may be a better way, I donβt know about this ... You can use the settings system to track if this is the first launch / update
Check if preference exists, if not, open the page, create a prefix with the current extension version number. If the preference exists, check it for the current version number of the extension, if they are different, suppose this is an update and open the page. (assuming you want the page to open every time it refreshes)
var prefs = Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefService); prefs.QueryInterface(Components.interfaces.nsIPrefBranch2); if ((prefs.getPrefType("extensions.yourextensionhere.yourprerference") == PREF_INVALID) || (prefs.getCharPref("extensions.yourextensionhere.yourprerference") != this.version)) { //open page and... prefs.setCharPref("extensions.yourextensionhere.yourprerference",this.version) }
EDIT .. check version == == instead of = = as it should be
source share