We are planning to deprecate the use by Firefox add-ons of the techniques described in this document.

Don't use these techniques to develop new add-ons. Use WebExtensions instead.

If you maintain an add-on which uses the techniques described here, consider migrating it to use WebExtensions instead.

Add-ons developed using these techniques might not work with multiprocess Firefox (e10s), which is already the default in Firefox Nightly and Firefox Developer Edition, and will soon be the default in Beta and Release versions of Firefox. We have documentation on making your add-ons multiprocess-compatible, but it will be more future-proof for you to migrate to WebExtensions.

A wiki page containing resources, migration paths, office hours, and more, is available to help developers transition to the new technologies.


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.





options : object
Required options:

Name Type  
branchName string

By default this is "", the root.


var { PrefsTarget } = require("sdk/preferences/event-target");

// listen to the same branch which reqire("sdk/simple-prefs") does
var target = PrefsTarget({ branchName: "extensions." + require("sdk/self").preferencesBranch + "." });

target.once("test", function(prefName) {
  console.log(prefName) // logs "test"
  console.log(target.prefs[name]) // logs true

target.once("", function() {
  console.log(prefName) // logs "test"
  console.log(target.prefs[name]) // logs true

// changing a pref which our target listens to
require("sdk/simple-prefs").prefs.test = true;

Document Tags and Contributors

 Contributors to this page: wbamberg, evold
 Last updated by: wbamberg,