Skip to content
Snippets Groups Projects
Commit 977565e1 authored by Nicolas Chevobbe's avatar Nicolas Chevobbe
Browse files

Bug 1801337 - Fix uninstall on sitepermission AddonCard created on the AOM...

Bug 1801337 - Fix uninstall on sitepermission AddonCard created on the AOM onInstalled event. r=rpl.

There are 2 folds to this patch.

First, the `SitePermsAddonInstalling` was calling its parent constructor (`SitePermsAddonWrapper`),
without the expected permissions parameter. This would then lead to the `uninstall`
method to not do anything as there were no permissions.
This is fixed by passing the permission for which we want to install the addon.

Second, if multiple addons were installed for the same origin (e.g. "midi" and "midi-sysex")
while about:addons was open, removing the addon would only revoke the "first" permission,
as `SitePermsAddonInstalling` only holds one permission.
To fix this, we define an `SitePermsAddonInstalling#uninstall` method that checks
if we registered a `SitePermsAddonWrapper` instance for this origin, and in such
case, uninstall the addon from this instance instead of the `SitePermsAddonInstalling`,
one, as the `SitePermsAddonWrapper` instance has the whole set of permissions
granted for a given origin.

Test cases are added to ensure we don't regress this.

Differential Revision: https://phabricator.services.mozilla.com/D162431
parent 04f9d277
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment