mozilla

Revision 44062 of Preferences API

  • Revision slug: Preferences_API
  • Revision title: Preferences API
  • Revision id: 44062
  • Created:
  • Creator: Bedi
  • Is current revision? No
  • Comment pl

Revision Content

Preferences API allows you to save and read strings, numbers, booleans, and references to files to the preferences store. It is relatively easy to use, while providing a number of useful user and developer features, including support for default preferences, user overrides via user.js, and locking.

You can also create a XUL-based options window easily to allow user modify some preferences. Many applications including Firefox and Thunderbird have an additional tool for power users, about:config, which can be used to tweak the preferences without UI.

Interfaces

The preferences API is exposed as a set of frozen XPCOM components and interfaces: nsIPrefService, nsIPrefBranch, nsIPrefBranch2.

...

See also

{{ wiki.languages( { "pl": "pl/Preferencje_API" } ) }}

Revision Source

<p>
</p><p>Preferences API allows you to save and read strings, numbers, booleans, and references to files to the preferences store. It is relatively easy to use, while providing a <a class="external" href="http://www.mozilla.org/catalog/end-user/customizing/briefprefs.html">number of useful user and developer features</a>, including support for default preferences, user overrides via user.js, and locking.
</p><p>You can also create a XUL-based <a href="en/Preferences_System"> options window</a> easily to allow user modify some preferences. Many applications including Firefox and Thunderbird have an additional tool for power users, <a class="external" href="http://kb.mozillazine.org/about:config">about:config</a>, which can be used to tweak the preferences without UI.
</p>
<h3 name="Interfaces"> Interfaces </h3>
<p>The preferences API is exposed as a set of frozen XPCOM components and interfaces: <code><a href="en/NsIPrefService">nsIPrefService</a></code>, <code><a href="en/NsIPrefBranch">nsIPrefBranch</a></code>, <code><a href="en/NsIPrefBranch2">nsIPrefBranch2</a></code>.
</p><p><span class="comment">...</span>
</p>
<h3 name="See_also"> See also </h3>
<ul><li> <a class="external" href="http://xulplanet.com/tutorials/xulqa/q_prefs.html">Brief introduction to using Preferences API in your code at xulplanet.com</a>
</li><li> <a href="en/Code_snippets/Preferences">Code snippets:Preferences</a> (more detailed discussion with multiple examples)
</li></ul>
{{ wiki.languages( { "pl": "pl/Preferencje_API" } ) }}
Revert to this revision