-
- Downloads
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
Showing
- toolkit/mozapps/extensions/internal/SitePermsAddonProvider.sys.mjs 31 additions, 3 deletions...ozapps/extensions/internal/SitePermsAddonProvider.sys.mjs
- toolkit/mozapps/extensions/test/browser/browser.ini 1 addition, 0 deletionstoolkit/mozapps/extensions/test/browser/browser.ini
- toolkit/mozapps/extensions/test/browser/browser_html_sitepermission_addons.js 187 additions, 0 deletions...nsions/test/browser/browser_html_sitepermission_addons.js
- toolkit/mozapps/extensions/test/xpcshell/test_sitePermsAddonProvider.js 12 additions, 0 deletions...s/extensions/test/xpcshell/test_sitePermsAddonProvider.js
Loading
Please register or sign in to comment