Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

Revision 992949 of system/xul-app

  • Revision slug: Mozilla/Add-ons/SDK/Low-Level_APIs/system_xul-app
  • Revision title: system/xul-app
  • Revision id: 992949
  • Created:
  • Creator: wbamberg
  • Is current revision? Yes
  • Comment

Revision Content

{{AddonSidebar}}

Experimental

Information about the application on which your add-on is running.

With the exception of ids, each of these properties exposes the attribute of the same name on the nsIXULAppInfo interface. For more information, see the MDN documentation.

Globals

Functions

is(name)

Checks whether the host application is the given application.

Parameters

name : string
A host application name.

Returns

boolean : True if the host application is name and false otherwise.

isOneOf(names)

Checks whether the host application is one of the given applications.

Parameters

names : array
An array of host application names.

Returns

boolean : True if the host application is one of the names and false otherwise.

versionInRange(version, lowInclusive, highExclusive)

Compares a given version to a version range. See the MDN documentation for details on version comparisons.

Parameters

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.

Returns

boolean : True if version falls in the given range and false otherwise.

Properties

ID

The GUID of the host application. For example, for Firefox this value is "{ec8030f7-c20a-464f-9b0e-13a3a9e97384}".

name

The host application name. The possible values here are:

  • "Firefox"
  • "Fennec"
  • "Mozilla"
  • "SeaMonkey"
  • "Sunbird"
  • "Thunderbird"

"Firefox"and"Fennec"` are the most commonly used values.

version

The host application version.

platformVersion

The Gecko/XULRunner platform version.

ids

A mapping of application names to their IDs. For example, ids["Firefox"] == "{ec8030f7-c20a-464f-9b0e-13a3a9e97384}".

Revision Source

{{AddonSidebar}}

<div class="note">
<p>Experimental</p>
</div>

<p><span class="seoSummary">Information about the application on which your add-on is running.</span></p>

<p>With the exception of <code>ids</code>, each of these properties exposes the attribute of the same name on the <a href="https://mxr.mozilla.org/mozilla-central/source/xpcom/system/nsIXULAppInfo.idl"><code>nsIXULAppInfo</code></a> interface. For more information, see the <a href="https://developer.mozilla.org/en/nsIXULAppInfo">MDN documentation</a>.</p>

<h2 id="Globals">Globals</h2>

<h3 id="Functions">Functions</h3>

<h4 class="addon-sdk-api-name" id="is(name)"><code>is(name)</code></h4>

<p>Checks whether the host application is the given application.</p>

<h5 id="Parameters">Parameters</h5>

<p><strong>name : string</strong><br />
 A host application name.</p>

<h5 id="Returns">Returns</h5>

<p><strong>boolean</strong> : True if the host application is <code>name</code> and false otherwise.</p>

<h4 class="addon-sdk-api-name" id="isOneOf(names)"><code>isOneOf(names)</code></h4>

<p>Checks whether the host application is one of the given applications.</p>

<h5 id="Parameters_2">Parameters</h5>

<p><strong>names : array</strong><br />
 An array of host application names.</p>

<h5 id="Returns_2">Returns</h5>

<p><strong>boolean</strong> : True if the host application is one of the <code>names</code> and false otherwise.</p>

<h4 class="addon-sdk-api-name" id="versionInRange(version_lowInclusive_highExclusive)"><code>versionInRange(version, lowInclusive, highExclusive)</code></h4>

<p>Compares a given version to a version range. See the <a href="https://developer.mozilla.org/en/Toolkit_version_format#Comparing_versions">MDN documentation</a> for details on version comparisons.</p>

<h5 id="Parameters_3">Parameters</h5>

<p><strong>version : string</strong><br />
 The version to compare.</p>

<p><strong>lowInclusive : string</strong><br />
 The lower bound of the version range to compare. The range includes this bound.</p>

<p><strong>highExclusive : string</strong><br />
 The upper bound of the version range to compare. The range does not include this bound.</p>

<h5 id="Returns_3">Returns</h5>

<p><strong>boolean</strong> : True if <code>version</code> falls in the given range and false otherwise.</p>

<h3 id="Properties">Properties</h3>

<h4 class="addon-sdk-api-name" id="ID"><code>ID</code></h4>

<p>The GUID of the host application. For example, for Firefox this value is <code>"{ec8030f7-c20a-464f-9b0e-13a3a9e97384}"</code>.</p>

<h4 class="addon-sdk-api-name" id="name"><code>name</code></h4>

<p>The host application name. The possible values here are:</p>

<ul>
 <li><code>"Firefox"</code></li>
 <li><code>"Fennec"</code></li>
 <li><code>"Mozilla"</code></li>
 <li><code>"SeaMonkey"</code></li>
 <li><code>"Sunbird"</code></li>
 <li><code>"Thunderbird"</code></li>
</ul>

<p>"Firefox"<code>and</code>"Fennec"` are the most commonly used values.</p>

<h4 class="addon-sdk-api-name" id="version"><code>version</code></h4>

<p>The host application version.</p>

<h4 class="addon-sdk-api-name" id="platformVersion"><code>platformVersion</code></h4>

<p>The Gecko/XULRunner platform version.</p>

<h4 class="addon-sdk-api-name" id="ids"><code>ids</code></h4>

<p>A mapping of application names to their IDs. For example, <code>ids["Firefox"] == "{ec8030f7-c20a-464f-9b0e-13a3a9e97384}"</code>.</p>
Revert to this revision