tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

appConstants.js (1304B)


      1 /* This Source Code Form is subject to the terms of the Mozilla Public
      2 * License, v. 2.0. If a copy of the MPL was not distributed with this
      3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
      4 
      5 "use strict";
      6 
      7 /* global AppConstants, ExtensionAPI, XPCOMUtils */
      8 
      9 this.appConstants = class extends ExtensionAPI {
     10  getAPI() {
     11    return {
     12      appConstants: {
     13        getAndroidPackageName: () => {
     14          return Services.env.get("MOZ_ANDROID_PACKAGE_NAME");
     15        },
     16        getEffectiveUpdateChannel: () => {
     17          const ver = AppConstants.MOZ_APP_VERSION_DISPLAY;
     18          if (ver.includes("a")) {
     19            return "nightly";
     20          } else if (ver.includes("b")) {
     21            return "beta";
     22          } else if (ver.includes("esr")) {
     23            return "esr";
     24          }
     25          return "stable";
     26        },
     27        getReleaseBranch: () => {
     28          if (AppConstants.NIGHTLY_BUILD) {
     29            return "nightly";
     30          } else if (AppConstants.MOZ_DEV_EDITION) {
     31            return "dev_edition";
     32          } else if (AppConstants.EARLY_BETA_OR_EARLIER) {
     33            return "early_beta_or_earlier";
     34          } else if (AppConstants.RELEASE_OR_BETA) {
     35            return "release_or_beta";
     36          }
     37          return "unknown";
     38        },
     39      },
     40    };
     41  }
     42 };