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


The navigator.getDataStores() method provides access to a list of the Data Store API data stores available on the device.


navigator.getDataStores('contacts').then(function(stores) {
  // do something with the array of data stores in stores


The name of the data store you want to return. An array is returned because there may be multiple data stores with the same name.


A Promise object that will resolve with an array of DataStore objects.


navigator.getDataStores('contacts').then(function(stores) {
  stores[0].getLength().then(function(storeLength) {
    if(storeLength == 0) {
      for(i = 0; i < contactsInit.length; i++) {
    } else {
      var cursor = stores[0].sync();


Specification Status Comment
Data Store API Draft The discussion concerning this API's creation happened in various Mozilla mailing lists and other places. A summary of the discussion and further pointers can be found on the Mozilla Wiki. For further feedback and questions, send mail to the dev-webapi mailing list.

Browser compatibility

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support No support No support No support No support No support
Feature Android Chrome Firefox Mobile (Gecko) Firefox OS IE Phone Opera Mobile Safari Mobile
Basic support No support No support No support 1.0.1 No support No support No support
Available in web workers No support No support No support 2.0 No support No support No support

See also

Document Tags and Contributors

 Contributors to this page: chrisdavidmills, teoli, fscholz
 Last updated by: chrisdavidmills,