Can not get extension's firstRun property after installing, if another extension trying to read its own data first.

NEW
Unassigned

Status

()

Firefox
General
7 years ago
6 years ago

People

(Reporter: pzhang, Unassigned)

Tracking

Trunk
x86
Windows 7
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

7 years ago
Created attachment 519604 [details]
Addons for testing

I am trying to do something when extension first run, here is the code:

	 window.addEventListener('load', function(e) {
	 	 if (Application.getExtensions) {
			 // Application.extensions is obsolete in Gecko 2.0
		 	Application.getExtensions(function(exts) {
	 			alert('addon1 firstRun: ' + exts.get("testaddon1@mozillaonline.com").firstRun);
	 		});
		 }
	 }, false);

It works only if other extensions didn't do this.
If other addon use 'Application.getExtensions' function, 'false' will be alerted after installing.

Attachment is two addons that doing the same thing, after installing, one alert 'true', but the other alert 'false';
Reading the FUEL code, it looks to be checking for a preference. If the preference does not exist, it creates the pref and sets firstRun to true. When FUEL was sync, this wasn't a problem as this check was only done once for the lifetime of application. Now that it's async, this check is done n times.

I'm not sure of the best way to fix this or whether we should drop firstRun entirely. It is a fairly useful attribute though.
You need to log in before you can comment on or make changes to this bug.