SettingsManager.onsettingchange

Non-standard
This feature is not on a current W3C standards track, but it is supported on the Firefox OS platform. Although implementations may change in the future and it is not supported widely across browsers, it is suitable for use in code dedicated to Firefox OS apps.

This API is available on Firefox OS for internal applications only.

Summary

The onsettingchange property lets you set an event handler to be called for all setting changes.

Syntax

SettingsManager.onsettingchange = funcRef;

Where funcRef is a function to be called when a setting state change. This function will receive as input a MozSettingsEvent describing the setting that changed.

Example

// Listen to changes on any settings
navigator.mozSettings.onsettingchange = function (event) {
  console.log(event.settingName + ": " + event.settingValue);
};

Specification

Not part of any specification yet; however, this API will be discussed at W3C as part of the System Applications Working Group.

See also

Document Tags and Contributors

Contributors to this page: teoli, abhishekp, kscarfone, Sheppy, Jeremie
Last updated by: teoli,