Closed Bug 553092 Opened 14 years ago Closed 14 years ago

Initialise the permissions manager

Categories

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

defect

Tracking

()

VERIFIED FIXED
mozilla1.9.3a5

People

(Reporter: mossop, Assigned: mossop)

References

Details

(Whiteboard: [rewrite][mozmill-test-needed])

Attachments

(1 file)

      No description provided.
Dave, can you please give a bit more details on that bug? Thanks.
The new code doesn't yet initialise the extension install whitelist
Dave, can we please get this bug fixed before our testday next Friday? It's a frustrating thing to always have to open the options dialog first, before you will be able to install any extension. I would like to see that we do not run into this problem during the testday.
Landed in http://hg.mozilla.org/projects/addonsmgr/rev/4ac299ae3dd0 and http://hg.mozilla.org/projects/addonsmgr/rev/7d4615d25f99
Status: NEW → ASSIGNED
Flags: in-testsuite+
Flags: in-litmus?
Whiteboard: [rewrite] → [rewrite][fixed-in-addonsmgr][needs-review]
Attached patch patch rev 1Splinter Review
This is a simple patch that just removes all the various places we currently initialize the permissions manager and just does it on startup whenever the app changes. This shouldn't be costly, the permissions manager is loaded on every startup anyway (by opening the hidden window) and keeping the initialisation all in one place makes far more sense.
Attachment #440859 - Flags: review?(robert.bugzilla)
Comment on attachment 440859 [details] [diff] [review]
patch rev 1

>diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js
>--- a/browser/base/content/browser.js
>+++ b/browser/base/content/browser.js
>@@ -7570,33 +7570,16 @@ var LightWeightThemeWebInstaller = {
>     gBrowser.tabContainer.removeEventListener("TabSelect", this, false);
> 
>     this._manager.resetPreview();
>   },
> 
>   _isAllowed: function (node) {
>     var pm = Services.perms;
> 
>-    var prefs = [["xpinstall.whitelist.add", pm.ALLOW_ACTION],
>-                 ["xpinstall.whitelist.add.36", pm.ALLOW_ACTION],
>-                 ["xpinstall.blacklist.add", pm.DENY_ACTION]];
>-    prefs.forEach(function ([pref, permission]) {
>-      try {
>-        var hosts = gPrefService.getCharPref(pref);
>-      } catch (e) {}
>-
>-      if (hosts) {
>-        hosts.split(",").forEach(function (host) {
>-          pm.add(makeURI("http://" + host), "install", permission);
>-        });
>-
>-        gPrefService.setCharPref(pref, "");
>-      }
>-    });
>-
>     var uri = node.ownerDocument.documentURIObject;
>     return pm.testPermission(uri, "install") == pm.ALLOW_ACTION;
nit: just use Services.perms
Attachment #440859 - Flags: review?(robert.bugzilla) → review+
Whiteboard: [rewrite][fixed-in-addonsmgr][needs-review] → [rewrite][fixed-in-addonsmgr]
Whiteboard: [rewrite][fixed-in-addonsmgr] → [rewrite][fixed-in-addonsmgr][needs-landing]
http://hg.mozilla.org/mozilla-central/rev/393d1f6b7c3b
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Whiteboard: [rewrite][fixed-in-addonsmgr][needs-landing] → [rewrite]
Target Milestone: --- → mozilla1.9.3a5
Verified fixed with Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.3a5pre) Gecko/20100514 Minefield/3.7a5pre.

Dave, I have one remaining question for the Litmus test. Before that patch went in the user always had to open the preferences dialog to initialize the permission manager, right? Also after a restart and not only for a fresh profile.
Status: RESOLVED → VERIFIED
This would have only affected fresh profiles and yes previously opening the permissions preferences would have initialized it.
(In reply to comment #9)
> This would have only affected fresh profiles and yes previously opening the
> permissions preferences would have initialized it.

So a test like the following would fulfill all needs?

1. Create a fresh profile
2. Open AMO and try to install extension X

As result the extension has to be installed.
As long as the install dialog appears and no notification bar then yes that is a pass.
Flags: in-litmus? → in-litmus?(vlad.maniac)
Litmus test has been added:
https://litmus.mozilla.org/show_test.cgi?id=15217

Such a test would be perfect for Mozmill. Adding whiteboard entry.
Flags: in-litmus?(vlad.maniac) → in-litmus+
Whiteboard: [rewrite] → [rewrite][mozmill-test-needed]
Blocks: 728810
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: