[tbb-commits] [tor-browser/tor-browser-31.2.0esr-4.x-1] Bug 13301: Avoid incompatible extensions prompt.

mikeperry at torproject.org mikeperry at torproject.org
Fri Oct 24 01:20:02 UTC 2014


commit bc7f0127a2832ea6c9d7e72269404d9034793a92
Author: Kathy Brade <brade at pearlcrescent.com>
Date:   Tue Oct 14 15:10:49 2014 -0400

    Bug 13301: Avoid incompatible extensions prompt.
    
    When updating via the background / timer-based check, the updater reported to
    the user that some extensions were incompatible (not true).  The fix is to
    check extension compatibility against the platformVersion in a few more places
    (instead of against the appVersion, which is something like "4.0-alpha-3").
---
 toolkit/mozapps/update/content/updates.js |   35 +++++++++++++++++++++++++----
 toolkit/mozapps/update/jar.mn             |    2 +-
 2 files changed, 32 insertions(+), 5 deletions(-)

diff --git a/toolkit/mozapps/update/content/updates.js b/toolkit/mozapps/update/content/updates.js
index 7cebf0f..00cf228 100644
--- a/toolkit/mozapps/update/content/updates.js
+++ b/toolkit/mozapps/update/content/updates.js
@@ -1,3 +1,5 @@
+#filter substitution
+
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -49,6 +51,11 @@ const CERT_ATTR_CHECK_FAILED_NO_UPDATE  = 100;
 const CERT_ATTR_CHECK_FAILED_HAS_UPDATE = 101;
 const BACKGROUNDCHECK_MULTIPLE_FAILURES = 110;
 
+#ifdef TOR_BROWSER_VERSION
+# Add double-quotes back on (stripped by JarMaker.py).
+#expand const TOR_BROWSER_VERSION = "__TOR_BROWSER_VERSION__";
+#endif
+
 var gLogEnabled = false;
 var gUpdatesFoundPageId;
 
@@ -531,8 +538,13 @@ var gUpdates = {
       return;
     }
 
+#ifdef TOR_BROWSER_UPDATE
+    var appVersion = TOR_BROWSER_VERSION;
+#else
+    var appVersion = Services.appinfo.version;
+#endif
     if (!this.update.appVersion ||
-        Services.vc.compare(this.update.appVersion, Services.appinfo.version) == 0) {
+        Services.vc.compare(this.update.appVersion, appVersion) == 0) {
       aCallback(false);
       return;
     }
@@ -544,6 +556,11 @@ var gUpdates = {
 
     var self = this;
     AddonManager.getAllAddons(function(addons) {
+#ifdef TOR_BROWSER_UPDATE
+      let compatVersion = self.update.platformVersion;
+#else
+      let compatVersion = self.update.appVersion;
+#endif
       self.addons = [];
       addons.forEach(function(addon) {
         // Protect against code that overrides the add-ons manager and doesn't
@@ -572,7 +589,7 @@ var gUpdates = {
               !addon.appDisabled && !addon.userDisabled &&
               addon.scope != AddonManager.SCOPE_APPLICATION &&
               addon.isCompatible &&
-              !addon.isCompatibleWith(self.update.appVersion,
+              !addon.isCompatibleWith(compatVersion,
                                       self.update.platformVersion))
             self.addons.push(addon);
         }
@@ -842,9 +859,14 @@ var gIncompatibleCheckPage = {
     this._totalCount = gUpdates.addons.length;
 
     this._pBar.mode = "normal";
+#ifdef TOR_BROWSER_UPDATE
+    let compatVersion = gUpdates.update.platformVersion;
+#else
+    let compatVersion = gUpdates.update.appVersion;
+#endif
     gUpdates.addons.forEach(function(addon) {
       addon.findUpdates(this, AddonManager.UPDATE_WHEN_NEW_APP_DETECTED,
-                        gUpdates.update.appVersion,
+                        compatVersion,
                         gUpdates.update.platformVersion);
     }, this);
   },
@@ -869,8 +891,13 @@ var gIncompatibleCheckPage = {
     // the add-on will become incompatible.
     let bs = CoC["@mozilla.org/extensions/blocklist;1"].
              getService(CoI.nsIBlocklistService);
+#ifdef TOR_BROWSER_UPDATE
+    let compatVersion = gUpdates.update.platformVersion;
+#else
+    let compatVersion = gUpdates.update.appVersion;
+#endif
     if (bs.isAddonBlocklisted(addon,
-                              gUpdates.update.appVersion,
+                              compatVersion,
                               gUpdates.update.platformVersion))
       return;
 
diff --git a/toolkit/mozapps/update/jar.mn b/toolkit/mozapps/update/jar.mn
index 9bb5d2d..5347123 100644
--- a/toolkit/mozapps/update/jar.mn
+++ b/toolkit/mozapps/update/jar.mn
@@ -7,6 +7,6 @@ toolkit.jar:
   content/mozapps/update/history.xul                            (content/history.xul)
   content/mozapps/update/history.js                             (content/history.js)
   content/mozapps/update/updates.css                            (content/updates.css)
-  content/mozapps/update/updates.js                             (content/updates.js)
+* content/mozapps/update/updates.js                             (content/updates.js)
   content/mozapps/update/updates.xml                            (content/updates.xml)
   content/mozapps/update/updates.xul                            (content/updates.xul)





More information about the tbb-commits mailing list