summaryrefslogtreecommitdiffstats
path: root/dom/indexedDB/test/browser_permissionsSharedWorker.js
blob: 59fe53326d956deb93fb7a170032903eb8f19bb3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
onconnect = function(e) {
  e.ports[0].onmessage = function(e) {
    var request = indexedDB.open(e.data, { version: 1,
                                           storage: "persistent" });
    request.onsuccess = function(event) {
      e.target.postMessage({ status: 'success',
                             isIDBDatabase: (event.target.result instanceof IDBDatabase) });
    }

    request.onerror = function(event) {
      e.target.postMessage({ status: 'error', error: event.target.error.name });
    }
  }
}