Closed Bug 1477328 Opened 6 years ago Closed 6 years ago

mozAddonManager does not appear to enable static themes when installed via createInstall

Categories

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

defect

Tracking

()

VERIFIED FIXED
mozilla63
Tracking Status
firefox63 --- verified

People

(Reporter: scolville, Assigned: aswan)

Details

Attachments

(4 files)

If you install a static theme with mozAddonManager the static theme is not enabled after being downloaded and installed.

Using nightly set-up to consume add-ons from amo-dev run:

window.navigator.mozAddonManager.createInstall({url: 'https://addons-dev.allizom.org/firefox/downloads/file/255202/tigers_matter-1.0-fx.xpi?src=discovery-promo'}).then((obj) => obj.install());


Note the static theme is installed but not enabled.

It looks like until this is fixed that the old installTrigger.install() API might provide a workaround since this appears to work:

InstallTrigger.install({URL: 'https://addons-dev.allizom.org/firefox/downloads/file/255202/tigers_matter-1.0-fx.xpi?src=discovery-promo'});

Thanks to :rebm for discovering this issue and providing the test-case code examples.
Sending to aswan in case this is related to bug 1465938, though that checked out in 62.
Flags: needinfo?(aswan)
Priority: -- → P1
Pre-requisite steps: 

* Create the xpinstall.signatures.dev-root pref in about:config as a Boolean and set it to true.
* Create/set extensions.webapi.testing as a Boolean to true
* go to about:preferences#privacy Permissions heading and add an exception for dev (https://addons-dev.allizom.org) (See the "Exceptions" button next to "Warn you when websites try to install add-ons"). 


Issue reproduced running the examples in the OP in 63.0a1 (2018-07-20) (64-bit) on OSX.


See Attached logs for events following running the examples. Note that installating via mozAddonManager does not fire onEnabled.
It looks we can also do the following workaround too:

mozAddonManager.getAddonByID(guid).then((addon) => addon.setEnabled(true))

Here is a log with a bit more info:

https://irccloud.mozilla.com/pastebin/3r22a3sk/
Ugh, themes are a rats nest of special cases.
I'm trying to untangle this a bit, though depending on time, I may end up just throwing another special case onto the pile.
Stay tuned...
Assignee: nobody → aswan
Flags: needinfo?(aswan)
Attachment #8997604 - Flags: review?(kmaglione+bmo)
Comment on attachment 8997604 [details]
Bug 1477328 Ensure that themes installed via mozAddonManager are enabled

https://reviewboard.mozilla.org/r/261298/#review268392

::: toolkit/mozapps/extensions/test/browser/browser_webapi_theme.js:1
(Diff revision 1)
> +

"use strict";
Attachment #8997604 - Flags: review?(kmaglione+bmo) → review+
Pushed by aswan@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/dba533b5af6a
Ensure that themes installed via mozAddonManager are enabled r=kmag
Backout by apavel@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/0e42959ec73e
Backed out changeset dba533b5af6a for failing browser/components/extensions/test/browser/test-oop-extensions/browser_ext_browserAction_popup_preload.js
Pushed by apavel@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/ebcc9ed3dcd2
Ensure that themes installed via mozAddonManager are enabled r=kmag
:aswan relanded this because the failures appeared on the backout too, even if retriggers indicated your push was the cause. 
I apologize for the confusion.
https://hg.mozilla.org/mozilla-central/rev/ebcc9ed3dcd2
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla63
Flags: needinfo?(aswan)
Verfified as fixed in Firefox 63. I will attach a postfix video.
Status: RESOLVED → VERIFIED
Attached image Postfix video
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: