extISessionStorage

  • Revision slug: Toolkit_API/extISessionStorage
  • Revision title: extISessionStorage
  • Revision id: 130719
  • Created:
  • Creator: jenzed
  • Is current revision? No
  • Comment 62 words added, 3 words removed

Revision Content

 

{{ draft() }}

{{ Fx_minversion_header("3") }}

{{ tb_minversion_header("3") }}


extISessionStorage allows an extension to store data for the life time of the application (e.g. browser). extISessionStorage is defined in {{ source("toolkit/components/exthelper/extIApplication.idl") }}.

Implemented via XPCOM service for extIApplication: see the instructions on the FUEL (Firefox), STEEL (Thunderbird) and SMILE (SeaMonkey) pages.

Method overview

These methods are usually accessed via Application.storage.

Return Type Method
boolean has(in AString aName)
void set(in AString aName, in nsIVariant aValue)
nsIVariant get(in AString aName, in nsIVariant aDefaultValue)

Attributes

Attribute Type Description
events readonly attribute extIEvents The events object for the storage supports: "change"

Methods

has()

Determines if a storage item exists with the given name.

boolean has(in AString aName)
Parameters
aName
The name of an item
Return value

true if an item exists with the given name, false otherwise.

set()

Sets the value of a storage item with the given name.

void set(in AString aName, in nsIVariant aValue)
Parameters
aName
The name of an item
Return value

 

get()

Gets the value of a storage item with the given name. Returns a default value if the item does not exist.

nsIVariant get(in AString aName, in nsIVariant aDefaultValue)
Parameters
aName
The name of an item
Return value

value of the item or the given default value if no item exists with the given name.

See also

 FUEL (Firefox), STEEL (Thunderbird) and SMILE (SeaMonkey)

{{ languages( { "es": "es/FUEL/SessionStorage", "fr": "fr/FUEL/SessionStorage", "ja": "ja/FUEL/SessionStorage" } ) }}

Revision Source

<p> </p>
<p>{{ draft() }}</p>
<p>{{ Fx_minversion_header("3") }}</p>
<p>{{ tb_minversion_header("3") }}</p>
<p><br>
<code>extISessionStorage</code> allows an extension to store data for the life time of the application (e.g. browser). <code>extISessionStorage</code> is defined in {{ source("toolkit/components/exthelper/extIApplication.idl") }}.</p>
<p>Implemented via XPCOM service for <a class="internal" href="/en/Toolkit_API/extIApplication" title="en/Toolkit API/extIApplication"><code>extIApplication</code></a>: see the instructions on the <a class="internal" href="/en/FUEL" title="en/FUEL">FUEL</a> (Firefox), <a class="internal" href="/en/Thunderbird/STEEL" title="en/Thunderbird/STEEL">STEEL</a> (Thunderbird) and <a class="internal" href="/en/SeaMonkey/SMILE" title="en/SeaMonkey/SMILE">SMILE</a> (SeaMonkey) pages. </p>
<h2 name="Method_overview">Method overview</h2>
<p>These methods are usually accessed via <code>Application.storage</code>.</p>
<table class="standard-table"> <tbody> <tr> <th>Return Type</th> <th>Method</th> </tr> <tr> <td><code>boolean</code></td> <td><code><a href="#has.28.29">has</a>(in AString aName)</code></td> </tr> <tr> <td><code>void</code></td> <td><code><a href="#set.28.29">set</a>(in AString aName, in nsIVariant aValue)</code></td> </tr> <tr> <td><code>nsIVariant</code></td> <td><code><a href="#get.28.29">get</a>(in AString aName, in nsIVariant aDefaultValue)</code></td> </tr> </tbody>
</table>
<h2 name="Attributes">Attributes</h2>
<table class="standard-table"> <tbody> <tr> <td class="header">Attribute</td> <td class="header">Type</td> <td class="header">Description</td> </tr> <tr> <td><code>events</code></td> <td><code>readonly attribute extIEvents</code></td> <td>The events object for the storage supports: "change"</td> </tr> </tbody>
</table>
<h2 name="Methods">Methods</h2>
<h3 name="has.28.29">has()</h3>
<p>Determines if a storage item exists with the given name.</p>
<pre class="eval">boolean has(in AString aName)
</pre>
<h6 name="Parameters">Parameters</h6>
<dl> <dt><code>aName</code></dt> <dd>The name of an item</dd>
</dl>
<h6 name="Return_value">Return value</h6>
<p>true if an item exists with the given name, false otherwise.</p>
<h3 name="set.28.29">set()</h3>
<p>Sets the value of a storage item with the given name.</p>
<pre class="eval">void set(in AString aName, in nsIVariant aValue)
</pre>
<h6 name="Parameters_2">Parameters</h6>
<dl> <dt><code>aName</code></dt> <dd>The name of an item</dd>
</dl>
<h6 name="Return_value_2">Return value</h6>
<p> </p>
<h3 name="get.28.29">get()</h3>
<p>Gets the value of a storage item with the given name. Returns a default value if the item does not exist.</p>
<pre class="eval">nsIVariant get(in AString aName, in nsIVariant aDefaultValue)
</pre>
<h6 name="Parameters_3">Parameters</h6>
<dl> <dt><code>aName</code></dt> <dd>The name of an item</dd>
</dl>
<h6 name="Return_value_3">Return value</h6>
<p>value of the item or the given default value if no item exists with the given name.</p>
<h2 name="See_also">See also</h2>
<p> <a class="internal" href="/en/FUEL" title="en/FUEL">FUEL</a> (Firefox), <a class="internal" href="/en/Thunderbird/STEEL" title="en/Thunderbird/STEEL">STEEL</a> (Thunderbird) and <a class="internal" href="/en/SeaMonkey/SMILE" title="en/SeaMonkey/SMILE">SMILE</a> (SeaMonkey)</p>
<p>{{ languages( { "es": "es/FUEL/SessionStorage", "fr": "fr/FUEL/SessionStorage", "ja": "ja/FUEL/SessionStorage" } ) }}</p>
Revert to this revision