browser_permissionsSharedWorker.js 512 B

123456789101112131415
  1. onconnect = function(e) {
  2. e.ports[0].onmessage = function(e) {
  3. var request = indexedDB.open(e.data, { version: 1,
  4. storage: "persistent" });
  5. request.onsuccess = function(event) {
  6. e.target.postMessage({ status: 'success',
  7. isIDBDatabase: (event.target.result instanceof IDBDatabase) });
  8. }
  9. request.onerror = function(event) {
  10. e.target.postMessage({ status: 'error', error: event.target.error.name });
  11. }
  12. }
  13. }