3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 this.EXPORTED_SYMBOLS = ["UpdateChannel"];
9 const Cu = Components.utils;
11 Cu.import("resource://gre/modules/Services.jsm");
13 this.UpdateChannel = {
15 * Read the update channel from defaults only. We do this to ensure that
16 * the channel is tightly coupled with the application and does not apply
17 * to other instances of the application that may use the same profile.
19 * @param [optional] aIncludePartners
20 * Whether or not to include the partner bits. Default: true.
22 get: function UpdateChannel_get(aIncludePartners = true) {
23 let channel = "@MOZ_UPDATE_CHANNEL@";
24 let defaults = Services.prefs.getDefaultBranch(null);
26 channel = defaults.getCharPref("app.update.channel");
28 // use default value when pref not found
31 if (aIncludePartners) {
33 let partners = Services.prefs.getChildList("app.partner.").sort();
34 if (partners.length) {
36 partners.forEach(function (prefName) {
37 channel += "-" + Services.prefs.getCharPref(prefName);