gecko-dev/dom/serviceworkers/test/worker_unregister.js
Victor Porof 0a8ff0ad85 Bug 1561435 - Format dom/, a=automatic-formatting
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D35951

--HG--
extra : source : 62f3501af4bc1c0bd1ee1977a28aee04706a6663
2019-07-05 10:44:55 +02:00

23 lines
415 B
JavaScript

onmessage = function(e) {
clients.matchAll().then(function(c) {
if (c.length === 0) {
// We cannot proceed.
return;
}
registration
.unregister()
.then(
function() {
c[0].postMessage("DONE");
},
function() {
c[0].postMessage("ERROR");
}
)
.then(function() {
c[0].postMessage("FINISH");
});
});
};