Add a way to uninstall existing add-ons.

RESOLVED FIXED in Firefox 48

Status

()

RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: mossop, Assigned: aswan)

Tracking

Trunk
mozilla48
Points:
---

Firefox Tracking Flags

(firefox48 fixed)

Details

Attachments

(1 attachment)

Comment hidden (empty)
(Assignee)

Updated

3 years ago
Assignee: nobody → aswan
(Assignee)

Comment 1

3 years ago
Created attachment 8743984 [details]
MozReview Request: Bug 1255041 Implement uninstall() on DOM Addon objects r?rhelmer

Review commit: https://reviewboard.mozilla.org/r/48219/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/48219/
Attachment #8743984 - Flags: review?(rhelmer)
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+
(Assignee)

Comment 3

3 years ago
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
(Assignee)

Comment 4

3 years ago
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/
(Assignee)

Updated

3 years ago
Iteration: --- → 48.3 - Apr 25
(Assignee)

Comment 5

3 years ago
One failure here in a loop test but it passed on retrigger:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=2b9ee3907cf4
Keywords: checkin-needed

Comment 7

3 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/c21153b1155f
Status: NEW → RESOLVED
Last Resolved: 3 years ago
status-firefox48: affected → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla48
You need to log in before you can comment on or make changes to this bug.