зеркало из https://github.com/mozilla/gecko-dev.git
18 строки
490 B
JavaScript
18 строки
490 B
JavaScript
/* eslint-env worker */
|
|
|
|
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 });
|
|
};
|
|
};
|
|
};
|