Closed Bug 1255041 Opened 8 years ago Closed 8 years ago

Add a way to uninstall existing add-ons.

Categories

(Toolkit :: Add-ons Manager, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla48
Iteration:
48.3 - Apr 25
Tracking Status
firefox48 --- fixed

People

(Reporter: mossop, Assigned: aswan)

References

Details

Attachments

(1 file)

      No description provided.
Assignee: nobody → aswan
Comment on attachment 8743984 [details]
MozReview Request: Bug 1255041 Implement uninstall() on DOM Addon objects r?rhelmer

https://reviewboard.mozilla.org/r/48219/#review45013

::: toolkit/mozapps/extensions/AddonManager.jsm:2874
(Diff revision 1)
> +          }
> +
> +          try {
> +            addon.uninstall();
> +            resolve(true);
> +          } catch (err) {

Can we log the error here too, maybe with `logger.warn()`?

::: toolkit/mozapps/extensions/test/browser/browser_webapi_uninstall.js:20
(Diff revision 1)
> +  }
> +}
> +
> +function API_uninstallByID(browser, id) {
> +  return ContentTask.spawn(browser, id, function*(id) {
> +    let addon = yield content.navigator.mozAddonManager.getAddonByID(id);

Do we need to test that `navigator.mozAddonManager` can't be accessed by disallowed sites or is that covered already elsewhere?
Attachment #8743984 - Flags: review?(rhelmer) → review+
https://reviewboard.mozilla.org/r/48219/#review45013

> Can we log the error here too, maybe with `logger.warn()`?

Yes, good idea, failures here should be infrequent (in fact, I couldn't come up with a good way to construct a scenario in which an uninstall fails which is why there isn't a test case of uninstall returning false).  I'll use `Cu.reportError` so we get the whole stack and such.

> Do we need to test that `navigator.mozAddonManager` can't be accessed by disallowed sites or is that covered already elsewhere?

That's mean to be covered here: https://dxr.mozilla.org/mozilla-central/source/toolkit/mozapps/extensions/test/browser/browser_webapi_access.js
Comment on attachment 8743984 [details]
MozReview Request: Bug 1255041 Implement uninstall() on DOM Addon objects r?rhelmer

Review request updated; see interdiff: https://reviewboard.mozilla.org/r/48219/diff/1-2/
Iteration: --- → 48.3 - Apr 25
One failure here in a loop test but it passed on retrigger:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=2b9ee3907cf4
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/c21153b1155f
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla48
You need to log in before you can comment on or make changes to this bug.