Bug 1466846 - Enabling addon should set homepage override. r=kmag, a=RyanVM
authorMichael Kaply <mozilla@kaply.com>
Fri, 22 Jun 2018 15:58:15 -0500
changeset 473800 f7ffdfcae3e7
parent 473799 d7133ef39f36
child 473801 7d280b7e277b
push id1740
push userryanvm@gmail.com
push date2018-07-04 00:31 +0000
treeherdermozilla-release@7d280b7e277b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskmag, RyanVM
bugs1466846
milestone61.0.1
Bug 1466846 - Enabling addon should set homepage override. r=kmag, a=RyanVM 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).