michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: "use strict"; michael@0: michael@0: module.metadata = { michael@0: "stability": "unstable" michael@0: }; michael@0: michael@0: const { Cc, Ci } = require("chrome"); michael@0: const runtime = Cc["@mozilla.org/xre/app-info;1"].getService(Ci.nsIXULRuntime); michael@0: michael@0: exports.inSafeMode = runtime.inSafeMode; michael@0: exports.OS = runtime.OS; michael@0: exports.processType = runtime.processType; michael@0: exports.widgetToolkit = runtime.widgetToolkit; michael@0: michael@0: // Attempt to access `XPCOMABI` may throw exception, in which case exported michael@0: // `XPCOMABI` will be set to `null`. michael@0: // https://mxr.mozilla.org/mozilla-central/source/toolkit/xre/nsAppRunner.cpp#732 michael@0: try { michael@0: exports.XPCOMABI = runtime.XPCOMABI; michael@0: } michael@0: catch (error) { michael@0: exports.XPCOMABI = null; michael@0: }