diff options
28 files changed, 12 insertions, 899 deletions
diff --git a/browser/app/profile/palemoon.js b/browser/app/profile/palemoon.js index e42d430f8..79b3f0b28 100644 --- a/browser/app/profile/palemoon.js +++ b/browser/app/profile/palemoon.js @@ -59,10 +59,6 @@ pref("extensions.blocklist.itemURL", "https://addons.mozilla.org/%LOCALE%/%APP%/ pref("extensions.update.autoUpdateDefault", true); -pref("extensions.hotfix.id", "firefox-hotfix@mozilla.org"); -pref("extensions.hotfix.cert.checkAttributes", true); -pref("extensions.hotfix.certs.1.sha1Fingerprint", "91:53:98:0C:C1:86:DF:47:8F:35:22:9E:11:C9:A7:31:04:49:A1:AA"); - // Disable add-ons that are not installed by the user in all scopes by default. // See the SCOPE constants in AddonManager.jsm for values to use here. pref("extensions.autoDisableScopes", 15); diff --git a/browser/base/content/aboutDialog.js b/browser/base/content/aboutDialog.js index 73b8708dd..f4c2a990c 100644 --- a/browser/base/content/aboutDialog.js +++ b/browser/base/content/aboutDialog.js @@ -5,8 +5,6 @@ // Services = object with smart getters for common XPCOM services Components.utils.import("resource://gre/modules/Services.jsm"); -const PREF_EM_HOTFIX_ID = "extensions.hotfix.id"; - function init(aEvent) { if (aEvent.target != document) @@ -355,11 +353,6 @@ appUpdater.prototype = * Checks the compatibility of add-ons for the application update. */ checkAddonCompatibility: function() { - try { - var hotfixID = Services.prefs.getCharPref(PREF_EM_HOTFIX_ID); - } - catch (e) { } - var self = this; AddonManager.getAllAddons(function(aAddons) { self.addons = []; @@ -384,13 +377,11 @@ appUpdater.prototype = // incompatible. If an addon's type equals plugin it is skipped since // checking plugins compatibility information isn't supported and // getting the scope property of a plugin breaks in some environments - // (see bug 566787). The hotfix add-on is also ignored as it shouldn't - // block the user from upgrading. + // (see bug 566787). try { - if (aAddon.type != "plugin" && aAddon.id != hotfixID && + if (aAddon.type != "plugin" && aAddon.isCompatible && !aAddon.appDisabled && !aAddon.userDisabled && aAddon.scope != AddonManager.SCOPE_APPLICATION && - aAddon.isCompatible && !aAddon.isCompatibleWith(self.update.appVersion, self.update.platformVersion)) self.addons.push(aAddon); diff --git a/mobile/android/app/mobile.js b/mobile/android/app/mobile.js index 1c2180778..87ffc96cc 100644 --- a/mobile/android/app/mobile.js +++ b/mobile/android/app/mobile.js @@ -195,10 +195,6 @@ pref("extensions.minCompatibleAppVersion", "11.0"); pref("extensions.update.url", "https://versioncheck.addons.mozilla.org/update/VersionCheck.php?reqVersion=%REQ_VERSION%&id=%ITEM_ID%&version=%ITEM_VERSION%&maxAppVersion=%ITEM_MAXAPPVERSION%&status=%ITEM_STATUS%&appID=%APP_ID%&appVersion=%APP_VERSION%&appOS=%APP_OS%&appABI=%APP_ABI%&locale=%APP_LOCALE%¤tAppVersion=%CURRENT_APP_VERSION%&updateType=%UPDATE_TYPE%&compatMode=%COMPATIBILITY_MODE%"); pref("extensions.update.background.url", "https://versioncheck-bg.addons.mozilla.org/update/VersionCheck.php?reqVersion=%REQ_VERSION%&id=%ITEM_ID%&version=%ITEM_VERSION%&maxAppVersion=%ITEM_MAXAPPVERSION%&status=%ITEM_STATUS%&appID=%APP_ID%&appVersion=%APP_VERSION%&appOS=%APP_OS%&appABI=%APP_ABI%&locale=%APP_LOCALE%¤tAppVersion=%CURRENT_APP_VERSION%&updateType=%UPDATE_TYPE%&compatMode=%COMPATIBILITY_MODE%"); -pref("extensions.hotfix.id", "firefox-android-hotfix@mozilla.org"); -pref("extensions.hotfix.cert.checkAttributes", true); -pref("extensions.hotfix.certs.1.sha1Fingerprint", "91:53:98:0C:C1:86:DF:47:8F:35:22:9E:11:C9:A7:31:04:49:A1:AA"); - /* preferences for the Get Add-ons pane */ pref("extensions.getAddons.cache.enabled", true); pref("extensions.getAddons.maxResults", 15); diff --git a/toolkit/mozapps/extensions/AddonManager.jsm b/toolkit/mozapps/extensions/AddonManager.jsm index 2437f6315..814fbd3e4 100644 --- a/toolkit/mozapps/extensions/AddonManager.jsm +++ b/toolkit/mozapps/extensions/AddonManager.jsm @@ -33,11 +33,6 @@ const PREF_EM_CHECK_UPDATE_SECURITY = "extensions.checkUpdateSecurity"; const PREF_EM_UPDATE_BACKGROUND_URL = "extensions.update.background.url"; const PREF_APP_UPDATE_ENABLED = "app.update.enabled"; const PREF_APP_UPDATE_AUTO = "app.update.auto"; -const PREF_EM_HOTFIX_ID = "extensions.hotfix.id"; -const PREF_EM_HOTFIX_LASTVERSION = "extensions.hotfix.lastVersion"; -const PREF_EM_HOTFIX_URL = "extensions.hotfix.url"; -const PREF_EM_CERT_CHECKATTRIBUTES = "extensions.hotfix.cert.checkAttributes"; -const PREF_EM_HOTFIX_CERTS = "extensions.hotfix.certs."; const PREF_MATCH_OS_LOCALE = "intl.locale.matchOS"; const PREF_SELECTED_LOCALE = "general.useragent.locale"; const UNKNOWN_XPCOM_ABI = "unknownABI"; @@ -629,7 +624,6 @@ var gCheckUpdateSecurityDefault = true; var gCheckUpdateSecurity = gCheckUpdateSecurityDefault; var gUpdateEnabled = true; var gAutoUpdateDefault = true; -var gHotfixID = null; var gShutdownBarrier = null; var gRepoShutdownState = ""; var gShutdownInProgress = false; @@ -901,11 +895,6 @@ var AddonManagerInternal = { } catch (e) {} Services.prefs.addObserver(PREF_EM_AUTOUPDATE_DEFAULT, this, false); - try { - gHotfixID = Services.prefs.getCharPref(PREF_EM_HOTFIX_ID); - } catch (e) {} - Services.prefs.addObserver(PREF_EM_HOTFIX_ID, this, false); - let defaultProvidersEnabled = true; try { defaultProvidersEnabled = Services.prefs.getBoolPref(PREF_DEFAULT_PROVIDERS_ENABLED); @@ -1183,7 +1172,6 @@ var AddonManagerInternal = { Services.prefs.removeObserver(PREF_EM_CHECK_UPDATE_SECURITY, this); Services.prefs.removeObserver(PREF_EM_UPDATE_ENABLED, this); Services.prefs.removeObserver(PREF_EM_AUTOUPDATE_DEFAULT, this); - Services.prefs.removeObserver(PREF_EM_HOTFIX_ID, this); let savedError = null; // Only shut down providers if they've been started. @@ -1301,14 +1289,6 @@ var AddonManagerInternal = { this.callManagerListeners("onUpdateModeChanged"); break; } - case PREF_EM_HOTFIX_ID: { - try { - gHotfixID = Services.prefs.getCharPref(PREF_EM_HOTFIX_ID); - } catch(e) { - gHotfixID = null; - } - break; - } } }, @@ -1401,12 +1381,6 @@ var AddonManagerInternal = { Cr.NS_ERROR_NOT_INITIALIZED); let buPromise = Task.spawn(function* backgroundUpdateTask() { - let hotfixID = this.hotfixID; - - let checkHotfix = hotfixID && - Services.prefs.getBoolPref(PREF_APP_UPDATE_ENABLED) && - Services.prefs.getBoolPref(PREF_APP_UPDATE_AUTO); - logger.debug("Background update check beginning"); Services.obs.notifyObservers(null, "addons-background-update-start", null); @@ -1426,10 +1400,6 @@ var AddonManagerInternal = { let updates = []; for (let addon of allAddons) { - if (addon.id == hotfixID) { - continue; - } - // Check all add-ons for updates so that any compatibility updates will // be applied updates.push(new Promise((resolve, reject) => { @@ -1454,92 +1424,6 @@ var AddonManagerInternal = { yield Promise.all(updates); } - if (checkHotfix) { - var hotfixVersion = ""; - try { - hotfixVersion = Services.prefs.getCharPref(PREF_EM_HOTFIX_LASTVERSION); - } - catch (e) { } - - let url = null; - if (Services.prefs.getPrefType(PREF_EM_HOTFIX_URL) == Ci.nsIPrefBranch.PREF_STRING) - url = Services.prefs.getCharPref(PREF_EM_HOTFIX_URL); - else - url = Services.prefs.getCharPref(PREF_EM_UPDATE_BACKGROUND_URL); - - // Build the URI from a fake add-on data. - url = AddonManager.escapeAddonURI({ - id: hotfixID, - version: hotfixVersion, - userDisabled: false, - appDisabled: false - }, url); - - Components.utils.import("resource://gre/modules/addons/AddonUpdateChecker.jsm"); - let update = null; - try { - let foundUpdates = yield new Promise((resolve, reject) => { - AddonUpdateChecker.checkForUpdates(hotfixID, null, url, { - onUpdateCheckComplete: resolve, - onUpdateCheckError: reject - }); - }); - update = AddonUpdateChecker.getNewestCompatibleUpdate(foundUpdates); - } catch (e) { - // AUC.checkForUpdates already logged the error - } - - // Check that we have a hotfix update, and it's newer than the one we already - // have installed (if any) - if (update) { - if (Services.vc.compare(hotfixVersion, update.version) < 0) { - logger.debug("Downloading hotfix version " + update.version); - let aInstall = yield new Promise((resolve, reject) => - AddonManager.getInstallForURL(update.updateURL, resolve, - "application/x-xpinstall", update.updateHash, null, - null, update.version)); - - aInstall.addListener({ - onDownloadEnded: function BUC_onDownloadEnded(aInstall) { - try { - if (!Services.prefs.getBoolPref(PREF_EM_CERT_CHECKATTRIBUTES)) - return; - } - catch (e) { - // By default don't do certificate checks. - return; - } - - try { - CertUtils.validateCert(aInstall.certificate, - CertUtils.readCertPrefs(PREF_EM_HOTFIX_CERTS)); - } - catch (e) { - logger.warn("The hotfix add-on was not signed by the expected " + - "certificate and so will not be installed.", e); - aInstall.cancel(); - } - }, - - onInstallEnded: function BUC_onInstallEnded(aInstall) { - // Remember the last successfully installed version. - Services.prefs.setCharPref(PREF_EM_HOTFIX_LASTVERSION, - aInstall.version); - }, - - onInstallCancelled: function BUC_onInstallCancelled(aInstall) { - // Revert to the previous version if the installation was - // cancelled. - Services.prefs.setCharPref(PREF_EM_HOTFIX_LASTVERSION, - hotfixVersion); - } - }); - - aInstall.install(); - } - } - } - logger.debug("Background update check complete"); Services.obs.notifyObservers(null, "addons-background-update-complete", @@ -2614,10 +2498,6 @@ var AddonManagerInternal = { Services.prefs.setBoolPref(PREF_EM_UPDATE_ENABLED, aValue); return aValue; }, - - get hotfixID() { - return gHotfixID; - }, }; /** @@ -2649,11 +2529,7 @@ this.AddonManagerPrivate = { backgroundUpdateTimerHandler() { // Don't call through to the real update check if no checks are enabled. - let checkHotfix = AddonManagerInternal.hotfixID && - Services.prefs.getBoolPref(PREF_APP_UPDATE_ENABLED) && - Services.prefs.getBoolPref(PREF_APP_UPDATE_AUTO); - - if (!AddonManagerInternal.updateEnabled && !checkHotfix) { + if (!AddonManagerInternal.updateEnabled) { logger.info("Skipping background update check"); return; } @@ -3131,10 +3007,6 @@ this.AddonManager = { AddonManagerInternal.autoUpdateDefault = aValue; }, - get hotfixID() { - return AddonManagerInternal.hotfixID; - }, - escapeAddonURI: function AM_escapeAddonURI(aAddon, aUri, aAppVersion) { return AddonManagerInternal.escapeAddonURI(aAddon, aUri, aAppVersion); }, diff --git a/toolkit/mozapps/extensions/content/extensions.js b/toolkit/mozapps/extensions/content/extensions.js index b3b9ee234..083b49069 100644 --- a/toolkit/mozapps/extensions/content/extensions.js +++ b/toolkit/mozapps/extensions/content/extensions.js @@ -2918,7 +2918,7 @@ var gDetailView = { downloadsRow.value = null; } - var canUpdate = !aIsRemote && hasPermission(aAddon, "upgrade") && aAddon.id != AddonManager.hotfixID; + var canUpdate = !aIsRemote && hasPermission(aAddon, "upgrade"); document.getElementById("detail-updates-row").hidden = !canUpdate; if ("applyBackgroundUpdates" in aAddon) { diff --git a/toolkit/mozapps/extensions/content/selectAddons.js b/toolkit/mozapps/extensions/content/selectAddons.js index 1243bc26c..33ab8a84e 100644 --- a/toolkit/mozapps/extensions/content/selectAddons.js +++ b/toolkit/mozapps/extensions/content/selectAddons.js @@ -73,9 +73,6 @@ var gChecking = { } aAddons = aAddons.filter(function gChecking_filterAddons(aAddon) { - if (aAddon.id == AddonManager.hotfixID) { - return false; - } if (aAddon.type == "plugin" || aAddon.type == "service") return false; diff --git a/toolkit/mozapps/extensions/content/update.js b/toolkit/mozapps/extensions/content/update.js index 2ddc33fe0..4e44b4f5e 100644 --- a/toolkit/mozapps/extensions/content/update.js +++ b/toolkit/mozapps/extensions/content/update.js @@ -195,10 +195,8 @@ var gVersionInfoPage = { logger.debug("repopulateCache completed after dialog closed"); } } - // Fetch the add-ons that are still affected by this update, - // excluding the hotfix add-on. - let idlist = [id for (id of gUpdateWizard.affectedAddonIDs) - if (id != AddonManager.hotfixID)]; + // Fetch the add-ons that are still affected by this update. + let idlist = [id for (id of gUpdateWizard.affectedAddonIDs)]; if (idlist.length < 1) { gVersionInfoPage.onAllUpdatesFinished(); return; diff --git a/toolkit/mozapps/extensions/internal/AddonRepository.jsm b/toolkit/mozapps/extensions/internal/AddonRepository.jsm index bc07ee12f..dc0221167 100644 --- a/toolkit/mozapps/extensions/internal/AddonRepository.jsm +++ b/toolkit/mozapps/extensions/internal/AddonRepository.jsm @@ -625,9 +625,6 @@ this.AddonRepository = { let allAddons = yield new Promise((resolve, reject) => AddonManager.getAllAddons(resolve)); - // Filter the hotfix out of our list of add-ons - allAddons = [a for (a of allAddons) if (a.id != AddonManager.hotfixID)]; - // Completely remove cache if caching is not enabled if (!this.cacheEnabled) { logger.debug("Clearing cache because it is disabled"); diff --git a/toolkit/mozapps/extensions/test/addons/test_hotfix_1/install.rdf b/toolkit/mozapps/extensions/test/addons/test_hotfix_1/install.rdf deleted file mode 100644 index 7fcc1a09e..000000000 --- a/toolkit/mozapps/extensions/test/addons/test_hotfix_1/install.rdf +++ /dev/null @@ -1,23 +0,0 @@ -<?xml version="1.0"?> - -<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:em="http://www.mozilla.org/2004/em-rdf#"> - - <Description about="urn:mozilla:install-manifest"> - <em:id>hotfix@tests.mozilla.org</em:id> - <em:version>1.0</em:version> - - <!-- Front End MetaData --> - <em:name>Test 1</em:name> - <em:description>Test Description</em:description> - - <em:targetApplication> - <Description> - <em:id>xpcshell@tests.mozilla.org</em:id> - <em:minVersion>1</em:minVersion> - <em:maxVersion>1</em:maxVersion> - </Description> - </em:targetApplication> - - </Description> -</RDF> diff --git a/toolkit/mozapps/extensions/test/addons/test_hotfix_2/install.rdf b/toolkit/mozapps/extensions/test/addons/test_hotfix_2/install.rdf deleted file mode 100644 index fd843dbe9..000000000 --- a/toolkit/mozapps/extensions/test/addons/test_hotfix_2/install.rdf +++ /dev/null @@ -1,23 +0,0 @@ -<?xml version="1.0"?> - -<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:em="http://www.mozilla.org/2004/em-rdf#"> - - <Description about="urn:mozilla:install-manifest"> - <em:id>hotfix@tests.mozilla.org</em:id> - <em:version>2.0</em:version> - - <!-- Front End MetaData --> - <em:name>Test 1</em:name> - <em:description>Test Description</em:description> - - <em:targetApplication> - <Description> - <em:id>xpcshell@tests.mozilla.org</em:id> - <em:minVersion>1</em:minVersion> - <em:maxVersion>1</em:maxVersion> - </Description> - </em:targetApplication> - - </Description> -</RDF> diff --git a/toolkit/mozapps/extensions/test/browser/browser.ini b/toolkit/mozapps/extensions/test/browser/browser.ini index 113cb03ae..dc6f86bd6 100644 --- a/toolkit/mozapps/extensions/test/browser/browser.ini +++ b/toolkit/mozapps/extensions/test/browser/browser.ini @@ -7,10 +7,6 @@ support-files = discovery.html discovery_frame.html discovery_install.html - signed_hotfix.rdf - signed_hotfix.xpi - unsigned_hotfix.rdf - unsigned_hotfix.xpi more_options.xul options.xul plugin_test.html @@ -43,7 +39,6 @@ skip-if = e10s [browser_cancelCompatCheck.js] [browser_checkAddonCompatibility.js] [browser_gmpProvider.js] -[browser_hotfix.js] [browser_installssl.js] [browser_newaddon.js] skip-if = e10s diff --git a/toolkit/mozapps/extensions/test/browser/browser_details.js b/toolkit/mozapps/extensions/test/browser/browser_details.js index 3dd708dc0..7394c87da 100644 --- a/toolkit/mozapps/extensions/test/browser/browser_details.js +++ b/toolkit/mozapps/extensions/test/browser/browser_details.js @@ -7,7 +7,6 @@ const PREF_AUTOUPDATE_DEFAULT = "extensions.update.autoUpdateDefault" const PREF_GETADDONS_GETSEARCHRESULTS = "extensions.getAddons.search.url"; const SEARCH_URL = TESTROOT + "browser_details.xml"; -const PREF_EM_HOTFIX_ID = "extensions.hotfix.id"; var gManagerWindow; var gCategoryUtilities; @@ -48,7 +47,6 @@ function test() { // Turn on searching for this test Services.prefs.setIntPref(PREF_SEARCH_MAXRESULTS, 15); Services.prefs.setCharPref(PREF_GETADDONS_GETSEARCHRESULTS, SEARCH_URL); - Services.prefs.setCharPref(PREF_EM_HOTFIX_ID, "hotfix@tests.mozilla.org"); waitForExplicitFinish(); @@ -143,9 +141,6 @@ function test() { blocklistURL: "http://example.com/addon8@tests.mozilla.org", name: "Test add-on 8", blocklistState: Ci.nsIBlocklistService.STATE_OUTDATED - }, { - id: "hotfix@tests.mozilla.org", - name: "Test hotfix 1", }]); open_manager(null, function(aWindow) { @@ -157,7 +152,6 @@ function test() { } function end_test() { - Services.prefs.clearUserPref(PREF_EM_HOTFIX_ID); close_manager(gManagerWindow, function() { finish(); }); @@ -686,26 +680,6 @@ add_test(function() { }); }); -// Opens and tests the details view for hotfix 1 -add_test(function() { - open_details("hotfix@tests.mozilla.org", "extension", function() { - is(get("detail-name").textContent, "Test hotfix 1", "Name should be correct"); - - is_element_hidden(get("detail-updates-row"), "Updates should be hidden"); - - is_element_hidden(get("detail-prefs-btn"), "Preferences button should be hidden"); - is_element_hidden(get("detail-enable-btn"), "Enable button should be hidden"); - is_element_visible(get("detail-disable-btn"), "Disable button should be visible"); - is_element_visible(get("detail-uninstall-btn"), "Remove button should be visible"); - - is_element_hidden(get("detail-warning"), "Warning message should be hidden"); - is_element_hidden(get("detail-warning-link"), "Warning link should be hidden"); - is_element_hidden(get("detail-pending"), "Pending message should be hidden"); - - run_next_test(); - }); -}); - // Tests that upgrades with onExternalInstall apply immediately add_test(function() { open_details("addon1@tests.mozilla.org", "extension", function() { diff --git a/toolkit/mozapps/extensions/test/browser/browser_hotfix.js b/toolkit/mozapps/extensions/test/browser/browser_hotfix.js deleted file mode 100644 index b7bb3f580..000000000 --- a/toolkit/mozapps/extensions/test/browser/browser_hotfix.js +++ /dev/null @@ -1,171 +0,0 @@ -/* Any copyright is dedicated to the Public Domain. - * http://creativecommons.org/publicdomain/zero/1.0/ - */ - -const PREF_EM_HOTFIX_ID = "extensions.hotfix.id"; -const PREF_EM_HOTFIX_LASTVERSION = "extensions.hotfix.lastVersion"; -const PREF_EM_HOTFIX_URL = "extensions.hotfix.url"; -const PREF_EM_HOTFIX_CERTS = "extensions.hotfix.certs."; -const PREF_EM_CERT_CHECKATTRIBUTES = "extensions.hotfix.cert.checkAttributes"; - -const PREF_INSTALL_REQUIREBUILTINCERTS = "extensions.install.requireBuiltInCerts"; -const PREF_UPDATE_REQUIREBUILTINCERTS = "extensions.update.requireBuiltInCerts"; - -const PREF_APP_UPDATE_ENABLED = "app.update.enabled"; -const PREF_APP_UPDATE_URL = "app.update.url"; - -const HOTFIX_ID = "hotfix@tests.mozilla.org"; - -/* - * Register an addon install listener and return a promise that: - * resolves with the AddonInstall object if the install succeeds - * rejects with the AddonInstall if the install fails - */ -function promiseInstallListener() { - return new Promise((resolve, reject) => { - let listener = { - onInstallEnded: ai => { - AddonManager.removeInstallListener(listener); - resolve(ai); - }, - onDownloadCancelled: ai => { - AddonManager.removeInstallListener(listener); - reject(ai); - } - }; - AddonManager.addInstallListener(listener); - }); -} - -function promiseSuccessfulInstall() { - return promiseInstallListener().then( - aInstall => { - ok(true, "Should have seen the install complete"); - is(aInstall.addon.id, HOTFIX_ID, "Should have installed the right add-on"); - aInstall.addon.uninstall(); - Services.prefs.clearUserPref(PREF_EM_HOTFIX_LASTVERSION); - }, - aInstall => { - ok(false, "Should not have seen the download cancelled"); - is(aInstall.addon.id, HOTFIX_ID, "Should have seen the right add-on"); - }); -} - -function promiseFailedInstall() { - return promiseInstallListener().then( - aInstall => { - ok(false, "Should not have seen the install complete"); - is(aInstall.addon.id, HOTFIX_ID, "Should have installed the right add-on"); - aInstall.addon.uninstall(); - Services.prefs.clearUserPref(PREF_EM_HOTFIX_LASTVERSION); - }, - aInstall => { - ok(true, "Should have seen the download cancelled"); - is(aInstall.addon.id, HOTFIX_ID, "Should have seen the right add-on"); - }); -} - -add_task(function setup() { - var oldAusUrl = Services.prefs.getDefaultBranch(null).getCharPref(PREF_APP_UPDATE_URL); - Services.prefs.getDefaultBranch(null).setCharPref(PREF_APP_UPDATE_URL, TESTROOT + "ausdummy.xml"); - Services.prefs.setBoolPref(PREF_APP_UPDATE_ENABLED, true); - Services.prefs.setBoolPref(PREF_INSTALL_REQUIREBUILTINCERTS, false); - Services.prefs.setBoolPref(PREF_UPDATE_REQUIREBUILTINCERTS, false); - Services.prefs.setCharPref(PREF_EM_HOTFIX_ID, HOTFIX_ID); - var oldURL = Services.prefs.getCharPref(PREF_EM_HOTFIX_URL); - Services.prefs.setCharPref(PREF_EM_HOTFIX_URL, TESTROOT + "signed_hotfix.rdf"); - - registerCleanupFunction(function() { - Services.prefs.setBoolPref(PREF_APP_UPDATE_ENABLED, false); - Services.prefs.getDefaultBranch(null).setCharPref(PREF_APP_UPDATE_URL, oldAusUrl); - Services.prefs.clearUserPref(PREF_EM_HOTFIX_ID); - Services.prefs.setCharPref(PREF_EM_HOTFIX_URL, oldURL); - Services.prefs.clearUserPref(PREF_INSTALL_REQUIREBUILTINCERTS); - Services.prefs.clearUserPref(PREF_UPDATE_REQUIREBUILTINCERTS); - - Services.prefs.clearUserPref(PREF_EM_CERT_CHECKATTRIBUTES); - var prefs = Services.prefs.getChildList(PREF_EM_HOTFIX_CERTS); - prefs.forEach(Services.prefs.clearUserPref); - }); -}); - -add_task(function* check_no_cert_checks() { - Services.prefs.setBoolPref(PREF_EM_CERT_CHECKATTRIBUTES, false); - yield Promise.all([ - promiseSuccessfulInstall(), - AddonManagerPrivate.backgroundUpdateCheck() - ]); -}); - -add_task(function* check_wrong_cert_fingerprint() { - Services.prefs.setBoolPref(PREF_EM_CERT_CHECKATTRIBUTES, true); - Services.prefs.setCharPref(PREF_EM_HOTFIX_CERTS + "1.sha1Fingerprint", "foo"); - - yield Promise.all([ - promiseFailedInstall(), - AddonManagerPrivate.backgroundUpdateCheck() - ]); - Services.prefs.clearUserPref(PREF_EM_HOTFIX_CERTS + "1.sha1Fingerprint"); -}); - -add_task(function* check_right_cert_fingerprint() { - Services.prefs.setBoolPref(PREF_EM_CERT_CHECKATTRIBUTES, true); - Services.prefs.setCharPref(PREF_EM_HOTFIX_CERTS + "1.sha1Fingerprint", "3E:B9:4E:07:12:FE:3C:01:41:46:13:46:FC:84:52:1A:8C:BE:1D:A2"); - - yield Promise.all([ - promiseSuccessfulInstall(), - AddonManagerPrivate.backgroundUpdateCheck() - ]); - - Services.prefs.clearUserPref(PREF_EM_HOTFIX_CERTS + "1.sha1Fingerprint"); -}); - -add_task(function* check_multi_cert_fingerprint_1() { - Services.prefs.setBoolPref(PREF_EM_CERT_CHECKATTRIBUTES, true); - Services.prefs.setCharPref(PREF_EM_HOTFIX_CERTS + "1.sha1Fingerprint", "3E:B9:4E:07:12:FE:3C:01:41:46:13:46:FC:84:52:1A:8C:BE:1D:A2"); - Services.prefs.setCharPref(PREF_EM_HOTFIX_CERTS + "2.sha1Fingerprint", "foo"); - - yield Promise.all([ - promiseSuccessfulInstall(), - AddonManagerPrivate.backgroundUpdateCheck() - ]); - - Services.prefs.clearUserPref(PREF_EM_HOTFIX_CERTS + "1.sha1Fingerprint"); - Services.prefs.clearUserPref(PREF_EM_HOTFIX_CERTS + "2.sha1Fingerprint"); -}); - -add_task(function* check_multi_cert_fingerprint_2() { - Services.prefs.setBoolPref(PREF_EM_CERT_CHECKATTRIBUTES, true); - Services.prefs.setCharPref(PREF_EM_HOTFIX_CERTS + "1.sha1Fingerprint", "foo"); - Services.prefs.setCharPref(PREF_EM_HOTFIX_CERTS + "2.sha1Fingerprint", "3E:B9:4E:07:12:FE:3C:01:41:46:13:46:FC:84:52:1A:8C:BE:1D:A2"); - - yield Promise.all([ - promiseSuccessfulInstall(), - AddonManagerPrivate.backgroundUpdateCheck() - ]); - - Services.prefs.clearUserPref(PREF_EM_HOTFIX_CERTS + "1.sha1Fingerprint"); - Services.prefs.clearUserPref(PREF_EM_HOTFIX_CERTS + "2.sha1Fingerprint"); -}); - -add_task(function* check_no_cert_no_checks() { - Services.prefs.setBoolPref(PREF_EM_CERT_CHECKATTRIBUTES, false); - Services.prefs.setCharPref(PREF_EM_HOTFIX_URL, TESTROOT + "unsigned_hotfix.rdf"); - - yield Promise.all([ - promiseSuccessfulInstall(), - AddonManagerPrivate.backgroundUpdateCheck() - ]); -}); - -add_task(function* check_no_cert_cert_fingerprint_check() { - Services.prefs.setBoolPref(PREF_EM_CERT_CHECKATTRIBUTES, true); - Services.prefs.setCharPref(PREF_EM_HOTFIX_CERTS + "1.sha1Fingerprint", "3E:B9:4E:07:12:FE:3C:01:41:46:13:46:FC:84:52:1A:8C:BE:1D:A2"); - - yield Promise.all([ - promiseFailedInstall(), - AddonManagerPrivate.backgroundUpdateCheck() - ]); - - Services.prefs.clearUserPref(PREF_EM_HOTFIX_CERTS + "1.sha1Fingerprint"); -}); diff --git a/toolkit/mozapps/extensions/test/browser/signed_hotfix.rdf b/toolkit/mozapps/extensions/test/browser/signed_hotfix.rdf deleted file mode 100644 index 39bd936c9..000000000 --- a/toolkit/mozapps/extensions/test/browser/signed_hotfix.rdf +++ /dev/null @@ -1,26 +0,0 @@ -<?xml version="1.0" encoding="utf-8" ?> - -<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:em="http://www.mozilla.org/2004/em-rdf#"> - - <Description about="urn:mozilla:extension:hotfix@tests.mozilla.org"> - <em:updates> - <Seq> - <li> - <Description> - <em:version>1.0</em:version> - <em:targetApplication> - <Description> - <em:id>toolkit@mozilla.org</em:id> - <em:minVersion>0</em:minVersion> - <em:maxVersion>*</em:maxVersion> - <em:updateLink>https://example.com/browser/toolkit/mozapps/extensions/test/browser/signed_hotfix.xpi</em:updateLink> - </Description> - </em:targetApplication> - </Description> - </li> - </Seq> - </em:updates> - </Description> - -</RDF> diff --git a/toolkit/mozapps/extensions/test/browser/signed_hotfix.xpi b/toolkit/mozapps/extensions/test/browser/signed_hotfix.xpi Binary files differdeleted file mode 100644 index bd1890573..000000000 --- a/toolkit/mozapps/extensions/test/browser/signed_hotfix.xpi +++ /dev/null diff --git a/toolkit/mozapps/extensions/test/browser/unsigned_hotfix.rdf b/toolkit/mozapps/extensions/test/browser/unsigned_hotfix.rdf deleted file mode 100644 index 2b4ba9362..000000000 --- a/toolkit/mozapps/extensions/test/browser/unsigned_hotfix.rdf +++ /dev/null @@ -1,26 +0,0 @@ -<?xml version="1.0" encoding="utf-8" ?> - -<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:em="http://www.mozilla.org/2004/em-rdf#"> - - <Description about="urn:mozilla:extension:hotfix@tests.mozilla.org"> - <em:updates> - <Seq> - <li> - <Description> - <em:version>1.0</em:version> - <em:targetApplication> - <Description> - <em:id>toolkit@mozilla.org</em:id> - <em:minVersion>0</em:minVersion> - <em:maxVersion>*</em:maxVersion> - <em:updateLink>https://example.com/browser/toolkit/mozapps/extensions/test/browser/unsigned_hotfix.xpi</em:updateLink> - </Description> - </em:targetApplication> - </Description> - </li> - </Seq> - </em:updates> - </Description> - -</RDF> diff --git a/toolkit/mozapps/extensions/test/browser/unsigned_hotfix.xpi b/toolkit/mozapps/extensions/test/browser/unsigned_hotfix.xpi Binary files differdeleted file mode 100644 index f2d475bd2..000000000 --- a/toolkit/mozapps/extensions/test/browser/unsigned_hotfix.xpi +++ /dev/null diff --git a/toolkit/mozapps/extensions/test/xpcshell/data/test_hotfix_1.rdf b/toolkit/mozapps/extensions/test/xpcshell/data/test_hotfix_1.rdf deleted file mode 100644 index 016726021..000000000 --- a/toolkit/mozapps/extensions/test/xpcshell/data/test_hotfix_1.rdf +++ /dev/null @@ -1,26 +0,0 @@ -<?xml version="1.0" encoding="utf-8" ?> - -<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:em="http://www.mozilla.org/2004/em-rdf#"> - - <Description about="urn:mozilla:extension:hotfix@tests.mozilla.org"> - <em:updates> - <Seq> - <li> - <Description> - <em:version>1.0</em:version> - <em:targetApplication> - <Description> - <em:id>xpcshell@tests.mozilla.org</em:id> - <em:minVersion>1</em:minVersion> - <em:maxVersion>1</em:maxVersion> - <em:updateLink>http://localhost:%PORT%/addons/test_hotfix_1.xpi</em:updateLink> - </Description> - </em:targetApplication> - </Description> - </li> - </Seq> - </em:updates> - </Description> - -</RDF> diff --git a/toolkit/mozapps/extensions/test/xpcshell/data/test_hotfix_2.rdf b/toolkit/mozapps/extensions/test/xpcshell/data/test_hotfix_2.rdf deleted file mode 100644 index 35a2befee..000000000 --- a/toolkit/mozapps/extensions/test/xpcshell/data/test_hotfix_2.rdf +++ /dev/null @@ -1,26 +0,0 @@ -<?xml version="1.0" encoding="utf-8" ?> - -<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:em="http://www.mozilla.org/2004/em-rdf#"> - - <Description about="urn:mozilla:extension:hotfix@tests.mozilla.org"> - <em:updates> - <Seq> - <li> - <Description> - <em:version>2.0</em:version> - <em:targetApplication> - <Description> - <em:id>xpcshell@tests.mozilla.org</em:id> - <em:minVersion>1</em:minVersion> - <em:maxVersion>1</em:maxVersion> - <em:updateLink>http://localhost:%PORT%/addons/test_hotfix_2.xpi</em:updateLink> - </Description> - </em:targetApplication> - </Description> - </li> - </Seq> - </em:updates> - </Description> - -</RDF> diff --git a/toolkit/mozapps/extensions/test/xpcshell/data/test_hotfix_3.rdf b/toolkit/mozapps/extensions/test/xpcshell/data/test_hotfix_3.rdf deleted file mode 100644 index 7180da143..000000000 --- a/toolkit/mozapps/extensions/test/xpcshell/data/test_hotfix_3.rdf +++ /dev/null @@ -1,26 +0,0 @@ -<?xml version="1.0" encoding="utf-8" ?> - -<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:em="http://www.mozilla.org/2004/em-rdf#"> - - <Description about="urn:mozilla:extension:hotfix@tests.mozilla.org"> - <em:updates> - <Seq> - <li> - <Description> - <em:version>3.0</em:version> - <em:targetApplication> - <Description> - <em:id>xpcshell@tests.mozilla.org</em:id> - <em:minVersion>2</em:minVersion> - <em:maxVersion>2</em:maxVersion> - <em:updateLink>http://localhost:%PORT%/addons/test_hotfix_3.xpi</em:updateLink> - </Description> - </em:targetApplication> - </Description> - </li> - </Seq> - </em:updates> - </Description> - -</RDF> diff --git a/toolkit/mozapps/extensions/test/xpcshell/head_addons.js b/toolkit/mozapps/extensions/test/xpcshell/head_addons.js index 64c0c7b36..4f8ffa1df 100644 --- a/toolkit/mozapps/extensions/test/xpcshell/head_addons.js +++ b/toolkit/mozapps/extensions/test/xpcshell/head_addons.js @@ -1460,9 +1460,6 @@ Services.prefs.setBoolPref("extensions.installDistroAddons", false); // By default use strict compatibility Services.prefs.setBoolPref("extensions.strictCompatibility", true); -// By default don't check for hotfixes -Services.prefs.setCharPref("extensions.hotfix.id", ""); - // By default, set min compatible versions to 0 Services.prefs.setCharPref(PREF_EM_MIN_COMPAT_APP_VERSION, "0"); Services.prefs.setCharPref(PREF_EM_MIN_COMPAT_PLATFORM_VERSION, "0"); diff --git a/toolkit/mozapps/extensions/test/xpcshell/test_backgroundupdate.js b/toolkit/mozapps/extensions/test/xpcshell/test_backgroundupdate.js index 3890b76e1..d69c33e33 100644 --- a/toolkit/mozapps/extensions/test/xpcshell/test_backgroundupdate.js +++ b/toolkit/mozapps/extensions/test/xpcshell/test_backgroundupdate.js @@ -92,10 +92,6 @@ function run_test_2() { "http://localhost:" + gPort +"/data/test_backgroundupdate.rdf"); restartManager(); - // Do hotfix checks - Services.prefs.setCharPref("extensions.hotfix.id", "hotfix@tests.mozilla.org"); - Services.prefs.setCharPref("extensions.hotfix.url", "http://localhost:" + gPort + "/missing.rdf"); - let installCount = 0; let completeCount = 0; let sawCompleteNotification = false; diff --git a/toolkit/mozapps/extensions/test/xpcshell/test_hotfix.js b/toolkit/mozapps/extensions/test/xpcshell/test_hotfix.js deleted file mode 100644 index c9303897f..000000000 --- a/toolkit/mozapps/extensions/test/xpcshell/test_hotfix.js +++ /dev/null @@ -1,309 +0,0 @@ -/* Any copyright is dedicated to the Public Domain. - * http://creativecommons.org/publicdomain/zero/1.0/ - */ - -// This verifies that hotfix installation works - -// The test extension uses an insecure update url. -Services.prefs.setBoolPref("extensions.checkUpdateSecurity", false); -// Ignore any certificate requirements the app has set -Services.prefs.setBoolPref("extensions.hotfix.cert.checkAttributes", false); - -Components.utils.import("resource://testing-common/httpd.js"); -var testserver = new HttpServer(); -testserver.start(-1); -gPort = testserver.identity.primaryPort; -testserver.registerDirectory("/addons/", do_get_file("addons")); -mapFile("/data/test_hotfix_1.rdf", testserver); -mapFile("/data/test_hotfix_2.rdf", testserver); -mapFile("/data/test_hotfix_3.rdf", testserver); - -const profileDir = gProfD.clone(); -profileDir.append("extensions"); - -function run_test() { - createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9.2"); - - startupManager(); - - do_test_pending(); - run_test_1(); -} - -function end_test() { - testserver.stop(do_test_finished); -} - -// Test that background updates find and install any available hotfix -function run_test_1() { - Services.prefs.setCharPref("extensions.hotfix.id", "hotfix@tests.mozilla.org"); - Services.prefs.setCharPref("extensions.update.background.url", "http://localhost:" + - gPort + "/data/test_hotfix_1.rdf"); - - prepare_test({ - "hotfix@tests.mozilla.org": [ - "onInstalling" - ] - }, [ - "onNewInstall", - "onDownloadStarted", - "onDownloadEnded", - "onInstallStarted", - "onInstallEnded", - ], callback_soon(check_test_1)); - - // We don't need to wait on the promise, just waiting for the install to finish is enough. - AddonManagerInternal.backgroundUpdateCheck(); -} - -function check_test_1() { - restartManager(); - - AddonManager.getAddonByID("hotfix@tests.mozilla.org", function(aAddon) { - do_check_neq(aAddon, null); - do_check_eq(aAddon.version, "1.0"); - - aAddon.uninstall(); - do_execute_soon(run_test_2); - }); -} - -// Don't install an already used hotfix -function run_test_2() { - restartManager(); - - AddonManager.addInstallListener({ - onNewInstall: function() { - do_throw("Should not have seen a new install created"); - } - }); - - // Run the background update - AddonManagerInternal.backgroundUpdateCheck().then(run_test_3); -} - -// Install a newer hotfix -function run_test_3() { - restartManager(); - Services.prefs.setCharPref("extensions.hotfix.url", "http://localhost:" + - gPort + "/data/test_hotfix_2.rdf"); - - prepare_test({ - "hotfix@tests.mozilla.org": [ - "onInstalling" - ] - }, [ - "onNewInstall", - "onDownloadStarted", - "onDownloadEnded", - "onInstallStarted", - "onInstallEnded", - ], callback_soon(check_test_3)); - - AddonManagerInternal.backgroundUpdateCheck(); -} - -function check_test_3() { - restartManager(); - - AddonManager.getAddonByID("hotfix@tests.mozilla.org", function(aAddon) { - do_check_neq(aAddon, null); - do_check_eq(aAddon.version, "2.0"); - - aAddon.uninstall(); - do_execute_soon(run_test_4); - }); -} - -// Don't install an incompatible hotfix -function run_test_4() { - restartManager(); - - Services.prefs.setCharPref("extensions.hotfix.url", "http://localhost:" + - gPort + "/data/test_hotfix_3.rdf"); - - AddonManager.addInstallListener({ - onNewInstall: function() { - do_throw("Should not have seen a new install created"); - } - }); - - AddonManagerInternal.backgroundUpdateCheck().then(run_test_5); -} - -// Don't install an older hotfix -function run_test_5() { - restartManager(); - - Services.prefs.setCharPref("extensions.hotfix.url", "http://localhost:" + - gPort + "/data/test_hotfix_1.rdf"); - - AddonManager.addInstallListener({ - onNewInstall: function() { - do_throw("Should not have seen a new install created"); - } - }); - - AddonManagerInternal.backgroundUpdateCheck().then(run_test_6); -} - -// Don't re-download an already pending install -function run_test_6() { - restartManager(); - - Services.prefs.setCharPref("extensions.hotfix.lastVersion", "0"); - Services.prefs.setCharPref("extensions.hotfix.url", "http://localhost:" + - gPort + "/data/test_hotfix_1.rdf"); - - prepare_test({ - "hotfix@tests.mozilla.org": [ - "onInstalling" - ] - }, [ - "onNewInstall", - "onDownloadStarted", - "onDownloadEnded", - "onInstallStarted", - "onInstallEnded", - ], callback_soon(check_test_6)); - - AddonManagerInternal.backgroundUpdateCheck(); -} - -function check_test_6() { - AddonManager.addInstallListener({ - onNewInstall: function() { - do_throw("Should not have seen a new install created"); - } - }); - - AddonManagerInternal.backgroundUpdateCheck() - .then(promiseRestartManager) - .then(() => promiseAddonByID("hotfix@tests.mozilla.org")) - .then(aAddon => { - aAddon.uninstall(); - run_test_7(); - }); -} - -// Start downloading again if something cancels the install -function run_test_7() { - restartManager(); - - Services.prefs.setCharPref("extensions.hotfix.lastVersion", "0"); - - prepare_test({ - "hotfix@tests.mozilla.org": [ - "onInstalling" - ] - }, [ - "onNewInstall", - "onDownloadStarted", - "onDownloadEnded", - "onInstallStarted", - "onInstallEnded", - ], check_test_7); - - AddonManagerInternal.backgroundUpdateCheck(); -} - -function check_test_7(aInstall) { - prepare_test({ - "hotfix@tests.mozilla.org": [ - "onOperationCancelled" - ] - }, [ - "onInstallCancelled", - ]); - - aInstall.cancel(); - - prepare_test({ - "hotfix@tests.mozilla.org": [ - "onInstalling" - ] - }, [ - "onNewInstall", - "onDownloadStarted", - "onDownloadEnded", - "onInstallStarted", - "onInstallEnded", - ], callback_soon(finish_test_7)); - - AddonManagerInternal.backgroundUpdateCheck(); -} - -function finish_test_7() { - restartManager(); - - AddonManager.getAddonByID("hotfix@tests.mozilla.org", function(aAddon) { - do_check_neq(aAddon, null); - do_check_eq(aAddon.version, "1.0"); - - aAddon.uninstall(); - do_execute_soon(run_test_8); - }); -} - -// Cancel a pending install when a newer version is already available -function run_test_8() { - restartManager(); - - Services.prefs.setCharPref("extensions.hotfix.lastVersion", "0"); - Services.prefs.setCharPref("extensions.hotfix.url", "http://localhost:" + - gPort + "/data/test_hotfix_1.rdf"); - - prepare_test({ - "hotfix@tests.mozilla.org": [ - "onInstalling" - ] - }, [ - "onNewInstall", - "onDownloadStarted", - "onDownloadEnded", - "onInstallStarted", - "onInstallEnded", - ], check_test_8); - - AddonManagerInternal.backgroundUpdateCheck(); -} - -function check_test_8() { - Services.prefs.setCharPref("extensions.hotfix.url", "http://localhost:" + - gPort + "/data/test_hotfix_2.rdf"); - - prepare_test({ - "hotfix@tests.mozilla.org": [ - "onOperationCancelled", - "onInstalling" - ] - }, [ - "onNewInstall", - "onDownloadStarted", - "onDownloadEnded", - "onInstallStarted", - "onInstallCancelled", - "onInstallEnded", - ], finish_test_8); - - AddonManagerInternal.backgroundUpdateCheck(); -} - -function finish_test_8() { - AddonManager.getAllInstalls(callback_soon(function(aInstalls) { - do_check_eq(aInstalls.length, 1); - do_check_eq(aInstalls[0].version, "2.0"); - - restartManager(); - - AddonManager.getAddonByID("hotfix@tests.mozilla.org", callback_soon(function(aAddon) { - do_check_neq(aAddon, null); - do_check_eq(aAddon.version, "2.0"); - - aAddon.uninstall(); - restartManager(); - - end_test(); - })); - })); -} diff --git a/toolkit/mozapps/extensions/test/xpcshell/test_pref_properties.js b/toolkit/mozapps/extensions/test/xpcshell/test_pref_properties.js index c6a10e7c1..9abffaab0 100644 --- a/toolkit/mozapps/extensions/test/xpcshell/test_pref_properties.js +++ b/toolkit/mozapps/extensions/test/xpcshell/test_pref_properties.js @@ -199,21 +199,6 @@ function run_test() { gManagerEventsListener.shutdown(); - // AddonManager.hotfixID - let hotfixID = "hotfix@tests.mozilla.org"; - Services.prefs.setCharPref("extensions.hotfix.id", hotfixID); - do_check_eq(AddonManager.hotfixID, hotfixID); - // Change the pref and make sure the property is updated - hotfixID = "hotfix2@tests.mozilla.org"; - Services.prefs.setCharPref("extensions.hotfix.id", hotfixID); - do_check_eq(AddonManager.hotfixID, hotfixID); - // Test an invalid pref value - hotfixID = 99; - Services.prefs.deleteBranch("extensions.hotfix.id"); - Services.prefs.setIntPref("extensions.hotfix.id", hotfixID); - do_check_eq(AddonManager.hotfixID, null); - Services.prefs.clearUserPref("extensions.hotfix.id"); - // After removing the listener, ensure we get no further events. gManagerEventsListener.expect([]); AddonManager.updateEnabled = false; diff --git a/toolkit/mozapps/extensions/test/xpcshell/xpcshell-shared.ini b/toolkit/mozapps/extensions/test/xpcshell/xpcshell-shared.ini index a4d6d792c..6081c8411 100644 --- a/toolkit/mozapps/extensions/test/xpcshell/xpcshell-shared.ini +++ b/toolkit/mozapps/extensions/test/xpcshell/xpcshell-shared.ini @@ -193,7 +193,6 @@ skip-if = os == "android" [test_gfxBlacklist_Vendor.js] [test_gfxBlacklist_prefs.js] [test_hasbinarycomponents.js] -[test_hotfix.js] [test_install.js] [test_install_icons.js] # Bug 676992: test consistently hangs on Android diff --git a/toolkit/mozapps/update/content/updates.js b/toolkit/mozapps/update/content/updates.js index 591c36446..c1949ce14 100644 --- a/toolkit/mozapps/update/content/updates.js +++ b/toolkit/mozapps/update/content/updates.js @@ -26,8 +26,6 @@ const PREF_APP_UPDATE_NOTIFIEDUNSUPPORTED = "app.update.notifiedUnsupported"; const PREF_APP_UPDATE_TEST_LOOP = "app.update.test.loop"; const PREF_PLUGINS_UPDATEURL = "plugins.update.url"; -const PREF_EM_HOTFIX_ID = "extensions.hotfix.id"; - const UPDATE_TEST_LOOP_INTERVAL = 2000; const URI_UPDATES_PROPERTIES = "chrome://mozapps/locale/update/updates.properties"; @@ -545,11 +543,6 @@ var gUpdates = { return; } - try { - var hotfixID = Services.prefs.getCharPref(PREF_EM_HOTFIX_ID); - } - catch (e) { } - var self = this; AddonManager.getAllAddons(function(addons) { self.addons = []; @@ -573,13 +566,11 @@ var gUpdates = { // incompatible. If an addon's type equals plugin it is skipped since // checking plugins compatibility information isn't supported and // getting the scope property of a plugin breaks in some environments - // (see bug 566787). The hotfix add-on is also ignored as it shouldn't - // block the user from upgrading. + // (see bug 566787). try { - if (addon.type != "plugin" && addon.id != hotfixID && - !addon.appDisabled && !addon.userDisabled && + if (addon.type != "plugin" && !addon.appDisabled && + !addon.userDisabled && addon.isCompatible && addon.scope != AddonManager.SCOPE_APPLICATION && - addon.isCompatible && !addon.isCompatibleWith(self.update.appVersion, self.update.platformVersion)) self.addons.push(addon); diff --git a/toolkit/mozapps/update/nsUpdateService.js b/toolkit/mozapps/update/nsUpdateService.js index 9214eb7b4..051044d22 100644 --- a/toolkit/mozapps/update/nsUpdateService.js +++ b/toolkit/mozapps/update/nsUpdateService.js @@ -61,8 +61,6 @@ const PREF_APP_DISTRIBUTION_VERSION = "distribution.version"; const PREF_APP_B2G_VERSION = "b2g.version"; -const PREF_EM_HOTFIX_ID = "extensions.hotfix.id"; - const URI_UPDATE_PROMPT_DIALOG = "chrome://mozapps/content/update/updates.xul"; const URI_UPDATE_HISTORY_DIALOG = "chrome://mozapps/content/update/history.xul"; const URI_BRAND_PROPERTIES = "chrome://branding/locale/brand.properties"; @@ -2748,11 +2746,6 @@ UpdateService.prototype = { }, _checkAddonCompatibility: function AUS__checkAddonCompatibility() { - try { - var hotfixID = Services.prefs.getCharPref(PREF_EM_HOTFIX_ID); - } - catch (e) { } - // Get all the installed add-ons var self = this; AddonManager.getAllAddons(function(addons) { @@ -2777,13 +2770,11 @@ UpdateService.prototype = { // incompatible. If an addon's type equals plugin it is skipped since // checking plugins compatibility information isn't supported and // getting the scope property of a plugin breaks in some environments - // (see bug 566787). The hotfix add-on is also ignored as it shouldn't - // block the user from upgrading. + // (see bug 566787). try { - if (addon.type != "plugin" && addon.id != hotfixID && + if (addon.type != "plugin" && addon.isCompatible && !addon.appDisabled && !addon.userDisabled && addon.scope != AddonManager.SCOPE_APPLICATION && - addon.isCompatible && !addon.isCompatibleWith(self._update.appVersion, self._update.platformVersion)) self._incompatibleAddons.push(addon); diff --git a/toolkit/mozapps/update/tests/chrome/utils.js b/toolkit/mozapps/update/tests/chrome/utils.js index 963a0c886..3486ea1e5 100644 --- a/toolkit/mozapps/update/tests/chrome/utils.js +++ b/toolkit/mozapps/update/tests/chrome/utils.js @@ -157,14 +157,13 @@ const PREF_APP_UPDATE_LASTUPDATETIME = "app.update.lastUpdateTime.background-upd // Preference for storing add-ons that are disabled by the tests to prevent them // from interefering with the tests. const PREF_DISABLEDADDONS = "app.update.test.disabledAddons"; -const PREF_EM_HOTFIX_ID = "extensions.hotfix.id"; const PREF_EM_SILENT = "app.update.silent"; const TEST_ADDONS = [ "appdisabled_1", "appdisabled_2", "compatible_1", "compatible_2", "noupdate_1", "noupdate_2", "updatecompatibility_1", "updatecompatibility_2", "updateversion_1", "updateversion_2", - "userdisabled_1", "userdisabled_2", "hotfix" ]; + "userdisabled_1", "userdisabled_2" ]; var gURLData = URL_HOST + "/" + REL_PATH_DATA + "/"; @@ -917,7 +916,6 @@ function setupPrefs() { Services.prefs.setIntPref(PREF_APP_UPDATE_IDLETIME, 0); Services.prefs.setIntPref(PREF_APP_UPDATE_PROMPTWAITTIME, 0); Services.prefs.setBoolPref(PREF_EXTENSIONS_STRICT_COMPAT, true); - Services.prefs.setCharPref(PREF_EM_HOTFIX_ID, "hotfix" + ADDON_ID_SUFFIX); Services.prefs.setBoolPref(PREF_EM_SILENT, false); } @@ -1069,10 +1067,6 @@ function resetPrefs() { Services.prefs.clearUserPref(PREF_EXTENSIONS_STRICT_COMPAT); } - if (Services.prefs.prefHasUserValue(PREF_EM_HOTFIX_ID)) { - Services.prefs.clearUserPref(PREF_EM_HOTFIX_ID); - } - if (Services.prefs.prefHasUserValue(PREF_EM_SILENT)) { Services.prefs.clearUserPref(PREF_EM_SILENT); } |