mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-05 12:05:22 +00:00
6a09c44325
--HG-- extra : commitid : 11uVDDnvoeE extra : rebase_source : 04651f9d10fe23b719800e0cf31174ba0239fd5e
25 lines
557 B
HTML
25 lines
557 B
HTML
<!DOCTYPE HTML>
|
|
<html>
|
|
<head>
|
|
<meta http-equiv="Content-type" content="text/html;charset=UTF-8">
|
|
<script>
|
|
|
|
function waitOnWorkerMessage(type) {
|
|
return new Promise(function(res, rej) {
|
|
function onMessage(e) {
|
|
if (e.data.type == type) {
|
|
navigator.serviceWorker.removeEventListener("message", onMessage);
|
|
(e.data.okay == "yes" ? res : rej)(e.data);
|
|
}
|
|
}
|
|
navigator.serviceWorker.addEventListener("message", onMessage);
|
|
});
|
|
}
|
|
|
|
</script>
|
|
</head>
|
|
<body>
|
|
|
|
</body>
|
|
</html>
|