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 file,
3 * You can obtain one at http://mozilla.org/MPL/2.0/. */
5 import { AppConstants } from "resource://gre/modules/AppConstants.sys.mjs";
7 const ID_FIREFOX = "{ec8030f7-c20a-464f-9b0e-13a3a9e97384}";
8 const ID_THUNDERBIRD = "{3550f703-e582-4d05-9a08-453d09bdfdc6}";
11 * Extends Services.appinfo with further properties that are
12 * used by different protocols as handled by the Remote Agent.
14 * @typedef {object} RemoteAgent.AppInfo
15 * @property {boolean} isAndroid - Whether the application runs on Android.
16 * @property {boolean} isLinux - Whether the application runs on Linux.
17 * @property {boolean} isMac - Whether the application runs on Mac OS.
18 * @property {boolean} isWindows - Whether the application runs on Windows.
19 * @property {boolean} isFirefox - Whether the application is Firefox.
20 * @property {boolean} isThunderbird - Whether the application is Thunderbird.
24 export const AppInfo = new Proxy(
28 if (target.hasOwnProperty(prop)) {
32 return Services.appinfo[prop];
39 ChromeUtils.defineLazyGetter(AppInfo, "isAndroid", () => {
40 return Services.appinfo.OS === "Android";
43 ChromeUtils.defineLazyGetter(AppInfo, "isLinux", () => {
44 return Services.appinfo.OS === "Linux";
47 ChromeUtils.defineLazyGetter(AppInfo, "isMac", () => {
48 return Services.appinfo.OS === "Darwin";
51 ChromeUtils.defineLazyGetter(AppInfo, "isWindows", () => {
52 return Services.appinfo.OS === "WINNT";
57 ChromeUtils.defineLazyGetter(AppInfo, "isFirefox", () => {
58 return Services.appinfo.ID == ID_FIREFOX;
61 ChromeUtils.defineLazyGetter(AppInfo, "isThunderbird", () => {
62 return Services.appinfo.ID == ID_THUNDERBIRD;
65 export function getTimeoutMultiplier() {
68 AppConstants.MOZ_CODE_COVERAGE ||
73 if (AppConstants.TSAN) {