Confirmed users
398
edits
| Line 51: | Line 51: | ||
Following is an example of finding Apps providing DataCloudStorage services with DeviceIndexedDB as the application chooser. | Following is an example of finding Apps providing DataCloudStorage services with DeviceIndexedDB as the application chooser. | ||
var request = window.deviceIndexedDB.open("[ | var request = window.deviceIndexedDB.open("[SystemServices]"); | ||
request.onsuccess = function () { | request.onsuccess = function () { | ||
var db = request.result; | var db = request.result; | ||
| Line 65: | Line 65: | ||
} | } | ||
The "[ | The "[SystemServices]" database is not necessary a real persistent data storage, it is implemented by the platform (Gecko) to provide the service. The line, chooserByIntent.get("DataCloudStorage"), would launch a application chooser by the platform. It return a list of applications once the user finish his selection. | ||
{ | |||
name: "My Applicaiton", | |||
...... | |||
deviceIndexedDB: { | |||
"[SystemServices]": { | |||
"Applications": { | |||
"ObjectStore": "none", | |||
"index": { | |||
"chooserByIntent": ["DataCloudStorage"], | |||
} | |||
} | |||
} | |||
} | |||
} | |||