This article is in need of a technical review.
This feature is non-standard and is not on a standards track. Do not use it on production sites facing the Web: it will not work for every user. There may also be large incompatibilities between implementations and the behavior may change in the future.
getDeviceStorages method is used to access individual storage area available on the device.
This method return an
DeviceStorage objects, one per physical storage area. To access a unified view of the storage area (as if there were only one physical storage area) it's recommended to use the
Note: To be able to use a storage area, the application must declare it in its application manifest. For example, if the application wants to access the
sdcard storage area, it must have the "
device-storage:sdcard" permission in its manifest.
var areas = navigator.getDeviceStorages(storageName);
The name of the targeted storage area. Firefox OS supports the following areas:
apps: This storage area is used to store the user data needed by apps. As it is critical data, accessing this storage area requires some extra privileges and is available for certified applications only.
music: This is the storage area where music and sounds are stored.
pictures: This is the storage area where pictures are stored.
sdcard: This is the storage area that gives access to the device's SDCards.
videos: This is the storage area where videos are stored.
var sdcards = navigator.getDeviceStorages("sdcard"); console.log("There are " + sdcards.length + " SDCards available.");
Not part of any specification.