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 750657 of preferences/event-target

  • Revision slug: Mozilla/Add-ons/SDK/Low-Level_APIs/preferences_event-target
  • Revision title: preferences/event-target
  • Revision id: 750657
  • Created:
  • Creator: evold
  • Is current revision? No
  • Comment
Tags: 

Revision Content

Unstable

Listen to changes to the Preferences system in Firefox. This enables add-ons to listen to change events to the system-wide settings. These are the same preferences that are exposed to users in the about:config page.
 
preferences/service gives you full access to the preferences system. You can also use the simple-prefs module to access just the preferences for your own add-on and expose them to the user in the Add-on Manager.

Globals

Constructor

PrefsTarget(options)

 

Parameters

Example:

var name = "extensions.checkCompatibility.nightly";
require("sdk/preferences/service").set(name, false);

Example

 

Revision Source

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

<p><span class="seoSummary">Listen to changes to the <a href="/en-US/docs/Mozilla/Preferences">Preferences</a> system in Firefox.</span> This enables add-ons to listen to change events to the system-wide settings. These are the same preferences that are exposed to users in the <code>about:config</code> page.<br />
 &nbsp;<br />
 <code>preferences/service</code> gives you full access to the preferences system. You can also use the <a href="/en-US/Add-ons/SDK/High-Level_APIs/simple-prefs">simple-prefs</a> module to access just the preferences for your own add-on and expose them to the user in the <a href="/en-US/docs/Mozilla/Add-ons/Add-on_Manager">Add-on Manager</a>.</p>

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

<h3 id="Constructor">Constructor</h3>

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

<p>&nbsp;</p>

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

<p><strong>Example:</strong></p>

<pre class="brush: js">
var name = "extensions.checkCompatibility.nightly";
require("sdk/preferences/service").set(name, false);</pre>

<h2 id="Example">Example</h2>

<pre class="brush: js">

&nbsp;</pre>
Revert to this revision