зеркало из https://github.com/mozilla/gecko-dev.git
18 строки
379 B
JavaScript
18 строки
379 B
JavaScript
function ok(aCondition, aMessage) {
|
|
return new Promise(function (resolve, reject) {
|
|
self.clients.matchAll().then(function (res) {
|
|
if (!res.length) {
|
|
reject();
|
|
return;
|
|
}
|
|
res[0].postMessage({
|
|
status: "callback",
|
|
data: "ok",
|
|
condition: aCondition,
|
|
message: aMessage,
|
|
});
|
|
resolve();
|
|
});
|
|
});
|
|
}
|