mozilla
Your Search Results

    DeviceStorageChangeEvent

    This article is in need of a technical review.

    この記事はまだ日本語に翻訳されていません。MDN の翻訳はボランティアによって行われています。是非 MDN に登録し、私たちの力になって下さい。

    Non-standard
    This feature is not on a current W3C standards track, but it is supported on the Firefox OS platform. Although implementations may change in the future and it is not supported widely across browsers, it is suitable for use in code dedicated to Firefox OS apps.

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

    Summary

    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.

    Properties

    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.

    Example

    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);
    });

    Specification

    Not part of any specification.

    See also

    ドキュメントのタグと貢献者

    Contributors to this page: fscholz, Jeremie, teoli, kscarfone, MHasan
    最終更新者: fscholz,