2015-04-10 20:19:28 -07:00
|
|
|
<!DOCTYPE HTML>
|
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<meta http-equiv="Content-type" content="text/html;charset=UTF-8">
|
|
|
|
<script>
|
|
|
|
|
2015-09-18 18:15:23 -07:00
|
|
|
|
|
|
|
function waitOnPushMessage(pushSubscription)
|
2015-04-10 20:19:28 -07:00
|
|
|
{
|
|
|
|
var p = new Promise(function(res, rej) {
|
2015-09-18 18:15:23 -07:00
|
|
|
navigator.serviceWorker.onmessage = function(e) {
|
|
|
|
if (e.data.type == "finished") {
|
2015-09-17 05:10:42 -07:00
|
|
|
(e.data.okay == "yes" ? res : rej)(e.data);
|
2015-04-10 20:19:28 -07:00
|
|
|
}
|
2015-09-18 18:15:23 -07:00
|
|
|
};
|
2015-04-10 20:19:28 -07:00
|
|
|
});
|
|
|
|
return p;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
</script>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
|
|
|
|
</body>
|
|
|
|
</html>
|