This API is available on Firefox OS for internal applications 仅。
This method fetches the value of a specified setting.
This method is asynchronous and returns a
DOMRequest
object, which you use to determine when the request has been completed so that you may act on the results.
SettingsLock.get(settingName);
settingName
This example checks to see if WiFi is enabled and reports the result.
var lock = navigator.mozSettings.createLock();
var req = lock.get('wifi.enabled');
req.onsuccess = function () {
console.log('wifi.enabled: ' + req.result['wifi.enabled']);
}
req.onerror = function () {
console.log('An error occured: ' + req.error);
}
Not part of any specification yet; however, this API will be discuss at W3C as part of the System Applications Working Group .