2023-05-20 15:26:49 +03:00
|
|
|
onmessage = function (e) {
|
|
|
|
clients.matchAll().then(function (c) {
|
2015-04-08 00:17:02 +03:00
|
|
|
if (c.length === 0) {
|
|
|
|
// We cannot proceed.
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
registration
|
|
|
|
.unregister()
|
|
|
|
.then(
|
2023-05-20 15:26:49 +03:00
|
|
|
function () {
|
2015-04-08 00:17:02 +03:00
|
|
|
c[0].postMessage("DONE");
|
|
|
|
},
|
2023-05-20 15:26:49 +03:00
|
|
|
function () {
|
2015-04-08 00:17:02 +03:00
|
|
|
c[0].postMessage("ERROR");
|
|
|
|
}
|
2019-07-05 11:44:55 +03:00
|
|
|
)
|
2023-05-20 15:26:49 +03:00
|
|
|
.then(function () {
|
2015-04-08 00:17:02 +03:00
|
|
|
c[0].postMessage("FINISH");
|
|
|
|
});
|
|
|
|
});
|
|
|
|
};
|