gecko-dev/dom/push/test/frame.html
Kit Cambridge 6a09c44325 Bug 1219064 - Add test for extendable pushsubscriptionchange event. r=mt
--HG--
extra : commitid : 11uVDDnvoeE
extra : rebase_source : 04651f9d10fe23b719800e0cf31174ba0239fd5e
2016-01-28 19:26:17 -08:00

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>