aboutsummaryrefslogtreecommitdiff
path: root/tools/addon-sdk-1.4/packages/api-utils/docs/xul-app.md
blob: 00379dbcd3bf311c761de0a4e947bc344acb9b61 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<!-- 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">
@property {string}
  The GUID of the host application.  For example, for Firefox this value is
  `"{ec8030f7-c20a-464f-9b0e-13a3a9e97384}"`.
</api>

<api name="name">
@property {string}
  The host application name.  For example, `"Firefox"`.
</api>

<api name="version">
@property {string}
  The host application version.
</api>

<api name="platformVersion">
@property {string}
  The Gecko/XULRunner platform version.
</api>

<api name="ids">
@property {object}
  A mapping of application names to their IDs.  For example,
  `ids["Firefox"] == "{ec8030f7-c20a-464f-9b0e-13a3a9e97384}"`.
</api>

<api name="is">
@function
  Checks whether the host application is the given application.
@param name {string}
  A host application name.
@returns {boolean}
  True if the host application is `name` and false otherwise.
</api>

<api name="isOneOf">
@function
  Checks whether the host application is one of the given applications.
@param names {array}
  An array of host application names.
@returns {boolean}
  True if the host application is one of the `names` and false otherwise.
</api>

<api name="versionInRange">
@function
  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.
@param version {string}
  The version to compare.
@param lowInclusive {string}
  The lower bound of the version range to compare.  The range includes this
  bound.
@param highExclusive {string}
  The upper bound of the version range to compare.  The range does not include
  this bound.
@returns {boolean}
  True if `version` falls in the given range and false otherwise.
</api>