Bug 1466846 - Enabling addon should set homepage override. r?kmag draft
authorMichael Kaply <mozilla@kaply.com>
Fri, 22 Jun 2018 15:58:15 -0500
changeset 809737 ae72c573333d
parent 808416 257c191e7903
push id113790
push usermozilla@kaply.com
push dateFri, 22 Jun 2018 20:58:30 +0000
reviewerskmag
bugs1466846
milestone62.0a1
Bug 1466846 - Enabling addon should set homepage override. r?kmag MozReview-Commit-ID: G9cfRuQjyGb
browser/components/extensions/parent/ext-chrome-settings-overrides.js
--- a/browser/components/extensions/parent/ext-chrome-settings-overrides.js
+++ b/browser/components/extensions/parent/ext-chrome-settings-overrides.js
@@ -180,17 +180,18 @@ this.chrome_settings_overrides = class e
     let {manifest} = extension;
 
     await ExtensionSettingsStore.initialize();
 
     let homepageUrl = manifest.chrome_settings_overrides.homepage;
 
     if (homepageUrl) {
       let inControl;
-      if (extension.startupReason == "ADDON_INSTALL") {
+      if (extension.startupReason == "ADDON_INSTALL" ||
+          extension.startupReason == "ADDON_ENABLE") {
         inControl = await ExtensionPreferencesManager.setSetting(
           extension.id, "homepage_override", homepageUrl);
       } else {
         let item = await ExtensionPreferencesManager.getSetting("homepage_override");
         inControl = item.id == extension.id;
       }
       // We need to add the listener here too since onPrefsChanged won't trigger on a
       // restart (the prefs are already set).