Bug 1553087 - Port bug 1504056: Adapt to changed parameters of AddonManager.getInstallForURL(). r=BenB,jorgk
authorNeil Rashbrook <neil@parkwaycc.co.uk>
Wed, 22 May 2019 23:52:45 +0200
changeset 35664 c4b00b0454bac43bcde2e95f160a44c65e6f2e78
parent 35663 8d7c421d2c4a710b33e5c5b96a84204ade76fb41
child 35665 4ae242ef0d4cbe718bba9bdd1dacd182ee0c5045
push id392
push userclokep@gmail.com
push dateMon, 02 Sep 2019 20:17:19 +0000
reviewersBenB, jorgk
bugs1553087, 1504056
Bug 1553087 - Port bug 1504056: Adapt to changed parameters of AddonManager.getInstallForURL(). r=BenB,jorgk
mail/components/accountcreation/content/util.js
mail/components/preferences/messengerLanguages.js
--- a/mail/components/accountcreation/content/util.js
+++ b/mail/components/accountcreation/content/util.js
@@ -499,17 +499,17 @@ AddonInstaller.prototype.isInstalled = a
 };
 
 /**
  * Downloads and installs the addon.
  * The downloaded XPI will be checked using prompt().
  */
 AddonInstaller.prototype._installDirect = async function() {
   var installer = this._installer = await AddonManager.getInstallForURL(
-    this._url, "application/x-xpinstall", null, this._name);
+    this._url, {name: this._name});
   installer.promptHandler = makeCallback(this, this.prompt);
   await installer.install(); // throws, if failed
 
   var addon = await AddonManager.getAddonByID(this._id);
   await addon.enable();
 
   // Wait for addon startup code to finish
   // Fixes: verify password fails with NOT_AVAILABLE in createIncomingServer()
--- a/mail/components/preferences/messengerLanguages.js
+++ b/mail/components/preferences/messengerLanguages.js
@@ -453,18 +453,17 @@ var gMessengerLanguagesDialog = {
 
   async requestRemoteLanguage(item) {
     this._availableLocales.disableWithMessageId("messenger-languages-downloading");
 
     let {url, hash} = this.availableLangpacks.get(item.value);
     let addon;
 
     try {
-      addon = await AddonManager.getInstallForURL(
-        url, "application/x-xpinstall", hash);
+      addon = await AddonManager.getInstallForURL(url, {hash});
       await addon.install();
     } catch (e) {
       this.showError();
       return;
     }
 
     // If the add-on was previously installed, it might be disabled still.
     if (addon.userDisabled) {