Open Bug 642086 Opened 13 years ago Updated 2 years ago

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

Categories

(Firefox :: General, defect)

x86
Windows 7
defect

Tracking

()

People

(Reporter: pzhang, Unassigned)

Details

Attachments

(1 file)

Attached file 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.
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: