Bug 1151507 - Warn users when unsigned add-ons have been disabled during startup. r=dtownsend
authorDão Gottwald <dao@mozilla.com>
Fri, 08 May 2015 19:27:56 +0200
changeset 274508 dbec5281f6255715621a258a15bd2b6baee25df8
parent 274507 ac36a281c5c13c27d724cc5b04739df300dfd913
child 274509 390f77eb9db61cea571dad4bab4469c3cb66a084
push id863
push userraliiev@mozilla.com
push dateMon, 03 Aug 2015 13:22:43 +0000
treeherdermozilla-release@f6321b14228d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdtownsend
bugs1151507
milestone40.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 1151507 - Warn users when unsigned add-ons have been disabled during startup. r=dtownsend
browser/components/nsBrowserGlue.js
--- a/browser/components/nsBrowserGlue.js
+++ b/browser/components/nsBrowserGlue.js
@@ -950,22 +950,24 @@ BrowserGlue.prototype = {
     // pdf content handler, and initializes parent side message manager
     // shim for privileged api access.
     PdfJs.init(true);
     // child only: similar to the call above for parent - register content
     // handler and init message manager child shim for privileged api access.
     // With older versions of the extension installed, this load will fail
     // passively.
     aWindow.messageManager.loadFrameScript("resource://pdf.js/pdfjschildbootstrap.js", true);
+
 #ifdef NIGHTLY_BUILD
     // Registering Shumway bootstrap script the child processes.
     aWindow.messageManager.loadFrameScript("chrome://shumway/content/bootstrap-content.js", true);
     // Initializing Shumway (shall be run after child script registration).
     ShumwayUtils.init();
 #endif
+
 #ifdef XP_WIN
     // For windows seven, initialize the jump list module.
     const WINTASKBAR_CONTRACTID = "@mozilla.org/windows-taskbar;1";
     if (WINTASKBAR_CONTRACTID in Cc &&
         Cc[WINTASKBAR_CONTRACTID].getService(Ci.nsIWinTaskbar).available) {
       let temp = {};
       Cu.import("resource:///modules/WindowsJumpLists.jsm", temp);
       temp.WinTaskbarJumpList.startup();
@@ -1000,16 +1002,24 @@ BrowserGlue.prototype = {
     } catch(e) {}
     if (!disableResetPrompt && lastUse &&
         Date.now() - lastUse >= OFFER_PROFILE_RESET_INTERVAL_MS) {
       this._resetUnusedProfileNotification();
     }
 
     this._checkForOldBuildUpdates();
 
+    let disabledAddons = AddonManager.getStartupChanges(AddonManager.STARTUP_CHANGE_DISABLED);
+    for (let id of disabledAddons) {
+      if (AddonManager.getAddonByID(id).signedState <= AddonManager.SIGNEDSTATE_MISSING) {
+        this._notifyUnsignedAddonsDisabled();
+        break;
+      }
+    }
+
     this._firstWindowTelemetry(aWindow);
   },
 
   /**
    * Application shutdown handler.
    */
   _onQuitApplicationGranted: function () {
     // This pref must be set here because SessionStore will use its value