Bug 1333620 Show the old post-install confirmation for non-restartless extensions r=mossop
authorAndrew Swan <aswan@mozilla.com>
Thu, 02 Feb 2017 14:29:34 -0800
changeset 332317 9b4b7718e37d112743e532ae267acd0a7db216ea
parent 332316 b90b9d2dfb3078636b8bf1d40d1f124974c0eb0e
child 332318 4290c796975c14b371178bb9666dca608c339fd6
push id31303
push usercbook@mozilla.com
push dateFri, 03 Feb 2017 12:23:51 +0000
treeherdermozilla-central@28bb04d0338d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmossop
bugs1333620
milestone54.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1333620 Show the old post-install confirmation for non-restartless extensions r=mossop MozReview-Commit-ID: FXAv4mzFsdI
toolkit/mozapps/extensions/AddonManager.jsm
--- a/toolkit/mozapps/extensions/AddonManager.jsm
+++ b/toolkit/mozapps/extensions/AddonManager.jsm
@@ -2105,17 +2105,19 @@ var AddonManagerInternal = {
         // If installing a theme that is disabled and can be enabled
         // then enable it
         if (install.addon.type == "theme" &&
             install.addon.userDisabled == true &&
             install.addon.appDisabled == false) {
               install.addon.userDisabled = false;
         }
 
-        if (WEBEXT_PERMISSION_PROMPTS) {
+        let needsRestart = (install.addon.pendingOperations != AddonManager.PENDING_NONE);
+
+        if (WEBEXT_PERMISSION_PROMPTS && !needsRestart) {
           let subject = {wrappedJSObject: {target: browser, addon: install.addon}};
           Services.obs.notifyObservers(subject, "webextension-install-notify", null);
         } else {
           self.installNotifyObservers("addon-install-complete", browser, url, install);
         }
       },
     };