just drop the current variant of this into the repo, still doesn't work as expected
[aboutcrashes.git] / js / aboutcrashes.js
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
3  * You can obtain one at http://mozilla.org/MPL/2.0/. */
4
5 window.onload = function() {
6   setTimeout(loadCrashes, 0);
7 }
8
9 function loadCrashes() {
10   if (navigator.getDeviceStorage) {
11     var storage = navigator.getDeviceStorage("apps");
12     if (storage) {
13       var getRequest = storage.get("b2g/mozilla/Crash\ Reports/submitted");
14
15       getRequest.onsuccess = function() {
16         document.getElementById("error").textContent = "got access";
17       };
18       getRequest.onerror = function() {
19         var errmsg = getRequest.error && getRequest.error.name;
20         document.getElementById("error").textContent = errmsg;
21       };
22     }
23     else {
24       document.getElementById("error").textContent = "apps storage not available";
25     }
26   }
27   else {
28     document.getElementById("error").textContent = "no device storage";
29   }
30 }