Closed Bug 555486 Opened 16 years ago Closed 16 years ago

Add information to the API about where add-ons are installed

Categories

(Toolkit :: Add-ons Manager, defect, P1)

defect

Tracking

()

VERIFIED FIXED
mozilla1.9.3a5

People

(Reporter: mossop, Assigned: mossop)

References

Details

(Keywords: dev-doc-complete, Whiteboard: [rewrite])

Attachments

(1 file, 1 obsolete file)

Going to group add-ons into the following general install areas: Application System User Profile
Status: NEW → ASSIGNED
Flags: in-testsuite+
Flags: in-litmus-
Whiteboard: [rewrite] → [rewrite][fixed-in-addonsmgr][needs-review]
Attached patch patch rev 1 (obsolete) — Splinter Review
Adds an Addon.scope property that holds the area an add-on is installed in. Also allows disabling certain scopes and disables the application scope for xpcshell tests which should stop issues with SeaMonkey etc.
Attachment #435778 - Flags: review?(robert.bugzilla)
Comment on attachment 435778 [details] [diff] [review] patch rev 1 It looks like you aren't turning off the registry install location by default for xpcshell which isn't really a problem as I see it but since we discussed it I am bringing it up. Is it possible to reload the extensions for mochitests using this method? >diff --git a/toolkit/mozapps/extensions/AddonManager.jsm b/toolkit/mozapps/extensions/AddonManager.jsm >--- a/toolkit/mozapps/extensions/AddonManager.jsm >+++ b/toolkit/mozapps/extensions/AddonManager.jsm >@@ -825,6 +825,16 @@ var AddonManager = { > // Indicates that the Addon can be upgraded. > PERM_CAN_UPGRADE: 8, > >+ // General descriptions of where items are installed. >+ // Installed in this profile. >+ SCOPE_PROFILE: 1, >+ // Installed and owned by the application. >+ SCOPE_APPLICATION: 2, >+ // Installed for all of this user's profiles. >+ SCOPE_USER: 4, >+ // Installed for all users of the computer. >+ SCOPE_SYSTEM: 8, Might be handy to have a SCOPE_ALL here > getInstallForURL: function AM_getInstallForURL(url, callback, mimetype, hash, > name, iconURL, version, > loadGroup) { >diff --git a/toolkit/mozapps/extensions/XPIProvider.jsm b/toolkit/mozapps/extensions/XPIProvider.jsm >--- a/toolkit/mozapps/extensions/XPIProvider.jsm >+++ b/toolkit/mozapps/extensions/XPIProvider.jsm >... >@@ -811,16 +812,44 @@ var XPIProvider = { > > let hasRegistry = ("nsIWindowsRegKey" in Ci); > >+ let enabledScopes = Prefs.getIntPref(PREF_EM_ENABLED_SCOPES, 15); and use SCOPE_ALL here >... >@@ -4397,6 +4437,20 @@ DirectoryInstallLocation.prototype = { > }, > > /** >+ * Gets the scope of this install location. >+ */ >+ get scope() { >+ return this._scope; >+ }, >+ >+ /** >+ * Gets the scope of this install location. >+ */ >+ get scope() { >+ return this._scope; >+ }, Two get scope()'s I'd prefer reviewing a new patch with the fixes above and against the changes from bug 555083 so r-. The tests look good so it shouldn't take long to finish the review for this.
Attachment #435778 - Flags: review?(robert.bugzilla) → review-
Whiteboard: [rewrite][fixed-in-addonsmgr][needs-review] → [rewrite][fixed-in-addonsmgr][needs-patch]
Attached patch patch rev 2Splinter Review
Attachment #435778 - Attachment is obsolete: true
Attachment #437326 - Flags: review?(robert.bugzilla)
Whiteboard: [rewrite][fixed-in-addonsmgr][needs-patch] → [rewrite][fixed-in-addonsmgr][needs-review]
Comment on attachment 437326 [details] [diff] [review] patch rev 2 Looks good
Attachment #437326 - Flags: review?(robert.bugzilla) → review+
Whiteboard: [rewrite][fixed-in-addonsmgr][needs-review] → [rewrite][fixed-in-addonsmgr][needs-landing]
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Whiteboard: [rewrite][fixed-in-addonsmgr][needs-landing] → [rewrite]
Target Milestone: --- → mozilla1.9.3a5
Verified fixed by check-in and passing automated tests.
Status: RESOLVED → VERIFIED
Do we document preferences? If so we should document extensions.enabledScopes, particularly the fact that you can't turn off the profile scope.
Keywords: dev-doc-needed
Blocks: 380871
(In reply to Eric Shepherd [:sheppy] from comment #9) > https://developer.mozilla.org/en/Addons/Add-on_Manager/ > AddonManager#Installation_scopes Those scopes are not correct. The list of current values can be found here: http://mxr.mozilla.org/mozilla-central/source/toolkit/mozapps/extensions/AddonManager.jsm#1258
(In reply to Henrik Skupin (:whimboo) from comment #10) > (In reply to Eric Shepherd [:sheppy] from comment #9) > > https://developer.mozilla.org/en/Addons/Add-on_Manager/ > > AddonManager#Installation_scopes > > Those scopes are not correct. The list of current values can be found here: > http://mxr.mozilla.org/mozilla-central/source/toolkit/mozapps/extensions/ > AddonManager.jsm#1258 They look exactly the same to me, they're just sorted into alphabetical order. I added the values of the constants to the table though.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: