SettingsManager.onsettingchange
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
JavaScript
Copy Code
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
JavaScript
Copy Code
// 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
License
© 2016 Mozilla Contributors
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-us/docs/web/api/settingsmanager/onsettingchange