This API is available on Firefox OS for privileged or certified applications 仅。

摘要

DeviceStorageChangeEvent provides information about any change made to a file inside a given storage area. It extends the 事件 接口。

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

特性

DeviceStorageChangeEvent.path 只读

A string giving the full path of the file affected by the change.

DeviceStorageChangeEvent.reason 只读
A string giving the reason of the change. Possible values are created , modified ,或 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.

另请参阅

元数据

  • 最后修改: