cfx
Version:
programmatically use cfx with node.js
87 lines (71 loc) • 2.62 kB
Markdown
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<!-- contributed by Drew Willcoxon [adw@mozilla.com] -->
The `xul-app` module provides facilities for introspecting the application on
which your program is running.
With the exception of `ids`, each of these properties exposes the attribute of
the same name on the [`nsIXULAppInfo`][nsIXULAppInfo] interface. For more
information, see the [MDC documentation][].
[nsIXULAppInfo]: http://mxr.mozilla.org/mozilla-central/source/xpcom/system/nsIXULAppInfo.idl
[MDC documentation]: https://developer.mozilla.org/en/nsIXULAppInfo
<api name="ID">
{string}
The GUID of the host application. For example, for Firefox this value is
`"{ec8030f7-c20a-464f-9b0e-13a3a9e97384}"`.
</api>
<api name="name">
{string}
The host application name. The possible values here are:
* `"Firefox"`
* `"Fennec"`
* `"Mozilla"`
* `"SeaMonkey"`
* `"Sunbird"`
* `"Thunderbird"`
"Firefox"` and `"Fennec"` are the most commonly used values.
</api>
<api name="version">
{string}
The host application version.
</api>
<api name="platformVersion">
{string}
The Gecko/XULRunner platform version.
</api>
<api name="ids">
{object}
A mapping of application names to their IDs. For example,
`ids["Firefox"] == "{ec8030f7-c20a-464f-9b0e-13a3a9e97384}"`.
</api>
<api name="is">
Checks whether the host application is the given application.
name {string}
A host application name.
{boolean}
True if the host application is `name` and false otherwise.
</api>
<api name="isOneOf">
Checks whether the host application is one of the given applications.
names {array}
An array of host application names.
{boolean}
True if the host application is one of the `names` and false otherwise.
</api>
<api name="versionInRange">
Compares a given version to a version range. See the [MDC documentation](https://developer.mozilla.org/en/Toolkit_version_format#Comparing_versions)
for details on version comparisons.
version {string}
The version to compare.
lowInclusive {string}
The lower bound of the version range to compare. The range includes this
bound.
highExclusive {string}
The upper bound of the version range to compare. The range does not include
this bound.
{boolean}
True if `version` falls in the given range and false otherwise.
</api>