This API is available on Firefox OS for privileged or certified applications only.


The DeviceStorageChangeEvent provides information about any change made to a file inside a given storage area. It extends the Event interface.

The change event is triggered each time a file is created, modified, or deleted from the device storage system.


DeviceStorageChangeEvent.path Read only
A string giving the full path of the file affected by the change.
DeviceStorageChangeEvent.reason Read only
A string giving the reason of the change. Possible values are created, modified, or deleted.


var sdcard = navigator.getDeviceStorage('sdcard');

sdcard.addEventListener("change", function (event) {
  var reason = event.reason;
  var path   = event.path;

  console.log('The file "' + path + '" has been ' + reason);


Not part of any specification.

See also


© 2016 Mozilla Contributors
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.

API B2G Device Storage Events events Firefox OS Non-standard Reference Référence WebAPI