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

VERIFIED FIXED in mozilla1.9.3a5

Status

()

defect
P1
normal
VERIFIED FIXED
9 years ago
8 years ago

People

(Reporter: mossop, Assigned: mossop)

Tracking

({dev-doc-complete})

Trunk
mozilla1.9.3a5
Points:
---
Dependency tree / graph
Bug Flags:
in-testsuite +
in-litmus -

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [rewrite])

Attachments

(1 attachment, 1 obsolete attachment)

Going to group add-ons into the following general install areas:

Application
System
User
Profile
Fixed in http://hg.mozilla.org/projects/addonsmgr/rev/789c015728d8
Status: NEW → ASSIGNED
Flags: in-testsuite+
Flags: in-litmus-
Whiteboard: [rewrite] → [rewrite][fixed-in-addonsmgr][needs-review]
Posted 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.
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]
Posted patch patch rev 2Splinter Review
Attachment #435778 - Attachment is obsolete: true
Attachment #437326 - Flags: review?(robert.bugzilla)
Assignee

Updated

9 years ago
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]
http://hg.mozilla.org/mozilla-central/rev/98501168f5fe
Status: ASSIGNED → RESOLVED
Closed: 9 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
Assignee

Updated

8 years ago
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.